build(modules): copy assets and module.txt every time processResources 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.
@@ -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 {
+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") {
