Update Examples
Some checks failed
ScriptCraft/pipeline/head There was a failure building this commit

This commit is contained in:
TheBrokenRail 2020-05-23 20:54:20 -04:00
parent e00f270827
commit 48796de9de
11 changed files with 47 additions and 20 deletions

View File

@ -70,6 +70,7 @@ publishing {
builtBy remapJar
}
artifact(typescriptAPI) {
classifier 'api'
builtBy typescriptAPI
}
}
@ -78,5 +79,6 @@ publishing {
maven {
url '/data/maven'
}
mavenLocal()
}
}

View File

@ -21,6 +21,8 @@ repositories {
}
}
apply from: './typescript.build.gradle'
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
@ -28,9 +30,9 @@ dependencies {
modImplementation "com.thebrokenrail:scriptcraft:${project.minecraft_version}"
include "com.thebrokenrail:scriptcraft:${project.minecraft_version}"
}
apply from: './typescript.build.gradle'
typescript "com.thebrokenrail:scriptcraft:${project.minecraft_version}:api"
}
processResources {
inputs.property 'version', mod_version

View File

@ -1,4 +1,3 @@
node_modules/
package-lock.json
scriptcraft/
lib/
build/

View File

@ -1,7 +1,6 @@
{
"devDependencies": {
"typescript": "latest",
"scriptcraft-api": "https://maven.thebrokenrail.com/com/thebrokenrail/scriptcraft/1.15.2/scriptcraft-1.15.2-api.tar.gz"
"typescript": "latest"
},
"scripts": {
"build": "tsc"

View File

@ -8,13 +8,12 @@
"module": "es2020",
"target": "es2020",
"removeComments": true,
"typeRoots": ["node_modules/scriptcraft-api/types"],
"rootDir": "src",
"baseUrl": "src",
"typeRoots": ["build/dependencies/types"],
"paths": {
"minecraft": ["../node_modules/scriptcraft-api/lib/minecraft/index.d.ts"]
"*": ["*", "../build/dependencies/lib/*"]
},
"outDir": "lib/ts",
"baseUrl": "src",
"outDir": "build/ts",
"moduleResolution": "node",
"resolveJsonModule": true
},

View File

@ -1,7 +1,7 @@
def typescriptRoot = 'src/main/ts'
def typescriptRootFile = new File(rootDir.absolutePath, typescriptRoot)
def typescriptOut = new File(typescriptRootFile, 'lib/ts')
def typescriptOut = new File(typescriptRootFile, 'build/ts')
def nodeModules = new File(typescriptRootFile, 'node_modules')
@ -22,6 +22,31 @@ task typescriptInstall(group: 'typescript', type: Exec) {
}
}
def typescriptDependencies = new File(typescriptRootFile, 'build/dependencies')
configurations {
typescript {
transitive false
}
}
task extractTypescriptDependencies(group: 'typescript') {
doFirst {
project.delete {
delete typescriptDependencies
}
typescriptDependencies.mkdirs()
configurations.typescript.resolve().each { file ->
project.copy {
from(zipTree(file).matching {
exclude 'META-INF', 'META-INF/**'
})
into typescriptDependencies
}
}
}
}
task typescript(group: 'typescript', type: Exec) {
inputs.dir typescriptRootFile
outputs.dirs typescriptOut
@ -40,6 +65,7 @@ task typescript(group: 'typescript', type: Exec) {
}
typescript.dependsOn typescriptInstall
typescript.dependsOn extractTypescriptDependencies
processResources.dependsOn typescript

View File

@ -1,5 +1,5 @@
#Sat Feb 29 21:58:32 EST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

View File

@ -1,3 +1,3 @@
node_modules/
package-lock.json
lib/
build/

View File

@ -11,9 +11,9 @@
"typeRoots": ["types"],
"rootDir": "src",
"baseUrl": "src",
"outDir": "lib/ts",
"outDir": "build/ts",
"declaration": true,
"declarationDir": "lib/dts",
"declarationDir": "build/dts",
"moduleResolution": "node",
"resolveJsonModule": true
},

View File

@ -5,5 +5,5 @@
"excludeExternals": true,
"excludePrivate": true,
"stripInternal": true,
"out": "lib/typedoc"
"out": "build/typedoc"
}

View File

@ -14,8 +14,8 @@ task typescriptInstall(group: 'typescript', type: Exec) {
args 'install'
}
def typescriptOut = new File(typescriptRootFile, 'lib/ts')
def dtsOut = new File(typescriptRootFile, 'lib/dts')
def typescriptOut = new File(typescriptRootFile, 'build/ts')
def dtsOut = new File(typescriptRootFile, 'build/dts')
task typescript(group: 'typescript', type: Exec) {
inputs.dir typescriptRootFile
@ -65,7 +65,7 @@ eslint.dependsOn typescriptInstall
processResources.dependsOn typescript
def typedocOut = new File(typescriptRootFile, 'lib/typedoc')
def typedocOut = new File(typescriptRootFile, 'build/typedoc')
task typedoc(group: 'typescript', type: Exec) {
inputs.dir typescriptRootFile