mirror of
https://github.com/naalit/slotlink.git
synced 2025-12-31 04:13:02 +00:00
fix dev run, only run datagen if files changed
This commit is contained in:
parent
0ce0df5482
commit
98e3f44ed1
3 changed files with 23 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -21,4 +21,4 @@ bin/
|
|||
run/
|
||||
logs/
|
||||
|
||||
src/generated/
|
||||
src/generated/output/
|
||||
|
|
|
|||
|
|
@ -51,12 +51,16 @@ sourceSets {
|
|||
}
|
||||
|
||||
val generated by creating {
|
||||
resources {
|
||||
compiledBy("runDatagen")
|
||||
resources {
|
||||
srcDir(file("src/generated/output"))
|
||||
}
|
||||
}
|
||||
|
||||
main.runtimeClasspath += generated.output
|
||||
devrun.apply {
|
||||
compileClasspath += generated.output
|
||||
runtimeClasspath += generated.output
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
|
|
@ -74,7 +78,7 @@ loom {
|
|||
name("Data Generation")
|
||||
vmArgs(
|
||||
"-Dfabric-api.datagen",
|
||||
"-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}",
|
||||
"-Dfabric-api.datagen.output-dir=${file("src/generated/output")}",
|
||||
"-Dfabric-api.datagen.modid=slotlink_datagen"
|
||||
)
|
||||
runDir("${project.buildDir}/datagen")
|
||||
|
|
@ -88,6 +92,11 @@ java {
|
|||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
tasks.getByName("runDatagen") {
|
||||
inputs.dir(file("src/datagen"))
|
||||
outputs.dir(file("src/generated"))
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
|
@ -100,10 +109,15 @@ tasks.withType<KotlinCompile> {
|
|||
|
||||
tasks.jar {
|
||||
from(sourceSets["generated"].output) {
|
||||
exclude("fabric.mod.json")
|
||||
exclude(".cache/**")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.getByName("processGeneratedResources") {
|
||||
dependsOn("runDatagen")
|
||||
}
|
||||
|
||||
tasks.withType<ProcessResources> {
|
||||
inputs.property("version", project.version)
|
||||
|
||||
|
|
|
|||
5
src/generated/resources/fabric.mod.json
Normal file
5
src/generated/resources/fabric.mod.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"id" : "slotlink_generated_data",
|
||||
"version" : "1"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue