File tree 1 file changed +16
-0
lines changed
src/main/kotlin/gg/essential
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,26 @@ when {
94
94
""" .trimIndent())
95
95
}
96
96
}
97
+ register(" generateModNameMarker" ) {
98
+ val modName = findProperty(" essential.loader.modName" )?.toString() ? : throw GradleException ("""
99
+ A mod name has not been set.
100
+ You need to set `essential.loader.modName` in the project's `gradle.properties` file to the name of your mod.
101
+ For example: `essential.loader.modName=Cool Mod`
102
+ """ .trimIndent())
103
+ val outputFile = file(" ${layout.buildDirectory} /generated-resources/essential-loader-mod-name.txt" )
104
+ outputs.file(outputFile)
105
+ doLast {
106
+ outputFile.writeText(modName)
107
+ }
108
+ }
97
109
named<ProcessResources >(" processResources" ) {
98
110
if (! isML8) {
99
111
dependsOn(named(" generateEssentialLoaderMixinConfig" ))
100
112
from(file(" ${layout.buildDirectory} /generated-resources/mixin.stage0.essential-loader.json" ))
113
+ dependsOn(named(" generateModNameMarker" ))
114
+ from(file(" ${layout.buildDirectory} /generated-resources/essential-loader-mod-name.txt" )) {
115
+ into(" META-INF" )
116
+ }
101
117
}
102
118
}
103
119
}
You can’t perform that action at this time.
0 commit comments