Skip to content

Commit

Permalink
loader/ml9: use task delegation and outputs directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Sychic committed Aug 25, 2024
1 parent 89a361e commit 6469fa1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/kotlin/gg/essential/essential-loader.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ when {
""".trimIndent())
val mixinConfigName = "mixin.essential-loader-stage0.$relocatedPackage.$modName.json"
tasks {
register("generateEssentialLoaderMixinConfig") {
val generateEssentialLoaderMixinConfig by registering {
val outputFile = file(generatedResourcesDirectory.get().file(mixinConfigName))
outputs.file(outputFile)
doLast {
Expand All @@ -91,18 +91,16 @@ when {
""".trimIndent())
}
}
register("generateModNameMarker") {
val generateModNameMarker by registering {
val outputFile = file(generatedResourcesDirectory.get().file("essential-loader-mod-name.txt"))
outputs.file(outputFile)
doLast {
outputFile.writeText(modName)
}
}
named<ProcessResources>("processResources") {
dependsOn(named("generateEssentialLoaderMixinConfig"))
from(file(generatedResourcesDirectory.get().file(mixinConfigName)))
dependsOn(named("generateModNameMarker"))
from(file(generatedResourcesDirectory.get().file("essential-loader-mod-name.txt"))) {
from(file(generateEssentialLoaderMixinConfig.map(Task::getOutputs)))
from(file(generateModNameMarker.map(Task::getOutputs))) {
into("META-INF")
}
}
Expand Down

0 comments on commit 6469fa1

Please sign in to comment.