Cleanup build script and hopefully fix datagen.

This commit is contained in:
modmuss50 2022-01-20 18:39:34 +00:00
parent 55eb70742f
commit 646132e908
2 changed files with 12 additions and 18 deletions

2
.gitignore vendored
View file

@ -24,7 +24,7 @@ changelog.txt
/logs/
/classes/
/src/main/resources/package-lock.json
/src/generated
/src/main/generated
/RebornCore/.gradle
/RebornCore/build

View file

@ -138,13 +138,6 @@ loom {
}
sourceSets {
// Add a generated resources directory
generated {
resources {
compiledBy("runDatagen")
}
}
// Add a data gen sourceset
datagen {
compileClasspath += main.compileClasspath
@ -161,8 +154,11 @@ sourceSets {
}
main {
runtimeClasspath += generated.runtimeClasspath
runtimeClasspath += generated.output
resources {
srcDirs += [
'src/main/generated'
]
}
}
}
@ -206,7 +202,7 @@ loom {
server()
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.modid=techreborn-datagen"
runDir "build/datagen"
source sourceSets.datagen
@ -230,27 +226,25 @@ loom {
}
}
}
assemble.dependsOn runDatagen
test.dependsOn runGametest
runDatagen {
// Doesnt re-run the task when its up-to date
outputs.dir('src/generated/resources')
outputs.dir('src/main/generated')
}
jar {
exclude "**/*.psd"
dependsOn("runDatagen")
from file('src/generated/resources')
from file('src/main/generated')
from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.json"} : null}
// A bit of a hack to allow the generated sources when they already exist
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn 'fixTranslations'
dependsOn 'runDatagen'
}
task crowdinExport() {
description "Triggers crowdin to export the latest translations"
onlyIf {