Skip to content

Commit

Permalink
skip genModHjson if no mod meta instead of not registered
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Dec 21, 2023
1 parent 4b2c2b1 commit ed1fe9e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions main/src/plugin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ class MindustryPlugin : Plugin<Project> {
target.tasks.register<CleanMindustrySharedCache>(R.task.cleanMindustrySharedCache) {
group = BasePlugin.BUILD_GROUP
}

val genModHjson = tasks.register<ModHjsonGenerate>(R.task.genModHjson) {
group = R.taskGroup.mindustry
modMeta.set(ex._modMeta)
output.set(temporaryDir.resolve("mod.hjson"))
}
target.afterEvaluateThis {
if (ex._modMeta.isPresent) {
tasks.register<ModHjsonGenerate>(R.task.genModHjson) {
group = R.taskGroup.mindustry
modMeta.set(ex._modMeta)
output.set(temporaryDir.resolve("mod.hjson"))
}

genModHjson.configure {
it.enabled = ex._modMeta.isPresent
}
}
}
Expand Down

0 comments on commit ed1fe9e

Please sign in to comment.