Skip to content

Commit

Permalink
build(modules): copy assets and module.txt every time processResource…
Browse files Browse the repository at this point in the history
…s is run

Instead of waiting for the jar task.

This is probably the reason things didn't seem to work unless you built jars _before_ running the code.
  • Loading branch information
keturn committed May 19, 2022
1 parent b5b42ae commit 3cf39f5
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions build-logic/src/main/kotlin/terasology-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,14 @@ tasks.register<Sync>("syncDeltas") {
into("${mainSourceSet.output.classesDirs.first()}/deltas")
}

// Instructions for packaging a jar file - is a manifest even needed for modules?
tasks.named("jar") {
// Make sure the assets directory is included
dependsOn("syncAssets")
dependsOn("syncOverrides")
dependsOn("syncDeltas")

// Jarring needs to copy module.txt and all the assets into the output
doFirst {
copy {
from("module.txt")
into(mainSourceSet.output.classesDirs.first())
}
}
tasks.register<Copy>("syncModuleInfo") {
from("module.txt")
into(mainSourceSet.output.classesDirs.first())
}

tasks.named("processResources") {
// Make sure the assets directory is included
dependsOn("syncAssets", "syncOverrides", "syncDeltas", "syncModuleInfo")
}

tasks.named<Test>("test") {
Expand Down

0 comments on commit 3cf39f5

Please sign in to comment.