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 builtBy remapJar
} }
artifact(typescriptAPI) { artifact(typescriptAPI) {
classifier 'api'
builtBy typescriptAPI builtBy typescriptAPI
} }
} }
@ -78,5 +79,6 @@ publishing {
maven { maven {
url '/data/maven' url '/data/maven'
} }
mavenLocal()
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
def typescriptRoot = 'src/main/ts' def typescriptRoot = 'src/main/ts'
def typescriptRootFile = new File(rootDir.absolutePath, typescriptRoot) 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') 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) { task typescript(group: 'typescript', type: Exec) {
inputs.dir typescriptRootFile inputs.dir typescriptRootFile
outputs.dirs typescriptOut outputs.dirs typescriptOut
@ -40,6 +65,7 @@ task typescript(group: 'typescript', type: Exec) {
} }
typescript.dependsOn typescriptInstall typescript.dependsOn typescriptInstall
typescript.dependsOn extractTypescriptDependencies
processResources.dependsOn typescript processResources.dependsOn typescript

View File

@ -1,5 +1,5 @@
#Sat Feb 29 21:58:32 EST 2020 #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 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

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

View File

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

View File

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

View File

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