@@ -5,48 +5,32 @@ plugins {
55 id ' maven-publish'
66 id ' com.gradleup.shadow' version ' 9.4.1'
77 id ' org.jetbrains.gradle.plugin.idea-ext' version ' 1.4.1'
8- id ' xyz.wagyourtail.unimined' version ' 1.4.18 -kappa'
8+ id ' xyz.wagyourtail.unimined' version ' 1.4.23 -kappa'
99 id ' net.kyori.blossom' version ' 2.2.0'
1010}
1111
1212import org.jetbrains.gradle.ext.Gradle
1313
14- apply from : ' gradle/scripts/helpers.gradle'
15-
16- // Early Assertions
17- assertProperty ' mod_version'
18- assertProperty ' root_package'
19- assertProperty ' mod_id'
20- assertProperty ' mod_name'
21-
22- assertSubProperties ' use_access_transformer' , ' access_transformer_locations'
23- assertSubProperties ' is_coremod' , ' coremod_includes_mod' , ' coremod_plugin_class_name'
24- assertSubProperties ' use_asset_mover' , ' asset_mover_version'
25-
26- setDefaultProperty ' generate_sources_jar' , true , false
27- setDefaultProperty ' generate_javadocs_jar' , true , false
28- setDefaultProperty ' minecraft_username' , true , ' Developer'
29- setDefaultProperty ' extra_jvm_args' , false , ' '
14+ ext {
15+ // noinspection GroovyAssignabilityCheck
16+ access_transformer_locations = " ${ mod_id} _at.cfg"
17+ }
3018
31- version = propertyString( ' mod_version' )
32- group = propertyString( ' root_package' )
19+ version = mod_version
20+ group = root_package
3321
3422base {
35- archivesName = propertyString(' mod_id' ) as String
36- }
37-
38- scala {
39- scalaVersion = ' 3.8.2'
23+ archivesName = mod_id
4024}
4125
4226java {
4327 toolchain {
4428 languageVersion = JavaLanguageVersion . of(25 )
4529 }
46- if (propertyBool( ' generate_sources_jar' )) {
30+ if (generate_sources_jar. toBoolean( )) {
4731 withSourcesJar()
4832 }
49- if (propertyBool( ' generate_javadocs_jar' )) {
33+ if (generate_javadocs_jar. toBoolean( )) {
5034 withJavadocJar()
5135 }
5236}
@@ -60,8 +44,9 @@ configurations {
6044 runtimeOnly. extendsFrom(modRuntimeOnly)
6145}
6246
63- String remapTaskName = propertyBool( ' enable_shadow' ) ? " remapShadowJar" : " remapJar"
47+ def remapTaskName = enable_shadow. toBoolean( ) ? " remapShadowJar" : " remapJar"
6448
49+ // noinspection GroovyAssignabilityCheck
6550unimined. minecraft {
6651 version " 1.12.2"
6752
@@ -70,38 +55,32 @@ unimined.minecraft {
7055 }
7156
7257 cleanroom {
73- if (propertyBool( ' use_access_transformer' )) {
74- accessTransformer " ${ rootProject.projectDir} /src/main/resources/${ propertyString(' access_transformer_locations') } "
58+ if (use_access_transformer. toBoolean( )) {
59+ accessTransformer " ${ rootProject.projectDir} /src/main/resources/$access_transformer_locations "
7560 }
76- loader " 0.5.12 -alpha"
61+ loader " 0.5.14 -alpha"
7762 runs. all {
7863 args + = [' --username' , minecraft_username]
79- def extraArgs = propertyString( ' extra_jvm_args' )
64+ def extraArgs = extra_jvm_args
8065 if (extraArgs != null && ! extraArgs. trim(). isEmpty()) {
8166 jvmArgs + = extraArgs. split { " \\ s+" }. toList()
8267 }
83- if (propertyBool( ' enable_foundation_debug' )) {
68+ if (enable_foundation_debug. toBoolean( )) {
8469 systemProperty(" foundation.dump" , " true" )
8570 systemProperty(" foundation.verbose" , " true" )
8671 }
87- if (propertyBool( ' is_coremod' )) {
88- systemProperty(" fml.coreMods.load" , propertyString( ' coremod_plugin_class_name' ) )
72+ if (is_coremod. toBoolean( )) {
73+ systemProperty(" fml.coreMods.load" , coremod_plugin_class_name)
8974 }
9075 return
9176 }
9277 }
9378
9479 defaultRemapJar = false
95-
96- String jarTaskName = propertyBool(' enable_shadow' ) ? " shadowJar" : " jar"
97-
98- remap(tasks. named(jarTaskName). get()) {
99- mixinRemap {
100- enableBaseMixin()
101- enableMixinExtra()
102- disableRefmap()
103- }
104- }
80+
81+ String jarTaskName = enable_shadow. toBoolean() ? " shadowJar" : " jar"
82+
83+ remap(tasks. named(jarTaskName). get())
10584
10685 mods {
10786 remap(configurations. modCompileOnly)
@@ -110,10 +89,10 @@ unimined.minecraft {
11089}
11190
11291dependencies {
113- if (propertyBool( ' use_asset_mover' )) {
114- implementation " com.cleanroommc:assetmover:${ propertyString(' asset_mover_version') } "
92+ if (use_asset_mover. toBoolean( )) {
93+ implementation " com.cleanroommc:assetmover:${ asset_mover_version} "
11594 }
116- if (propertyBool( ' enable_junit_testing' )) {
95+ if (enable_junit_testing. toBoolean( )) {
11796 testImplementation ' org.junit.jupiter:junit-jupiter:6.0.3'
11897 testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
11998 }
@@ -129,21 +108,21 @@ sourceSets {
129108 main {
130109 blossom {
131110 scalaSources {
132- property(' mod_id' , propertyString( ' mod_id' ) )
133- property(' mod_name' , propertyString( ' mod_name' ) )
134- property(' mod_version' , propertyString( ' mod_version' ) )
111+ property(' mod_id' , mod_id)
112+ property(' mod_name' , mod_name)
113+ property(' mod_version' , mod_version)
135114 property(' package' , " ${ root_package} .${ mod_id} " )
136115 }
137116 resources {
138- property(' mod_id' , propertyString( ' mod_id' ) )
139- property(' mod_name' , propertyString( ' mod_name' ) )
140- property(' mod_version' , propertyString( ' mod_version' ) )
141- property(' mod_description' , propertyString( ' mod_description' ) )
142- property(' mod_authors' , propertyStringList( ' mod_authors ' , ' , ' ) . collect {it. strip()}. join(' ", " ' ))
143- property(' mod_credits' , propertyString( ' mod_credits' ) )
144- property(' mod_url' , propertyString( ' mod_url' ) )
145- property(' mod_update_json' , propertyString( ' mod_update_json' ) )
146- property(' mod_logo_path' , propertyString( ' mod_logo_path' ) )
117+ property(' mod_id' , mod_id)
118+ property(' mod_name' , mod_name)
119+ property(' mod_version' , mod_version)
120+ property(' mod_description' , mod_description)
121+ property(' mod_authors' , mod_authors . toString() . split( ' , ' ) . findAll { ! it . isBlank() } . collect { " \" ${ it.strip()} \" " } . join(' , ' ))
122+ property(' mod_credits' , mod_credits)
123+ property(' mod_url' , mod_url)
124+ property(' mod_update_json' , mod_update_json)
125+ property(' mod_logo_path' , mod_logo_path)
147126 }
148127 }
149128 }
@@ -170,20 +149,20 @@ idea {
170149 afterEvaluate {
171150 javacAdditionalOptions = ' -encoding utf8'
172151 moduleJavacAdditionalOptions = [
173- (project. name + ' .main' ): tasks. compileJava. options. compilerArgs. collect { ' " ' + it + ' " ' }. join(' ' )
152+ (project. name + ' .main' ): tasks. compileJava. options. compilerArgs. collect { " \" ${ it } \" " }. join(' ' )
174153 ]
175154 }
176155 }
177156 }
178157 }
179158}
180159
181- if (! propertyBool( ' enable_shadow' )) {
160+ if (! enable_shadow. toBoolean( )) {
182161 shadowJar. enabled = false
183162}
184163
185164compileJava {
186- sourceCompatibility = targetCompatibility = JavaVersion . VERSION_21
165+ sourceCompatibility = targetCompatibility = JavaVersion . VERSION_25
187166}
188167
189168jar {
@@ -202,14 +181,14 @@ jar {
202181 attribute_map[' ContainedDeps' ] = configurations. contain. collect { it. name }. join(' ' )
203182 attribute_map[' NonModDeps' ] = true
204183 }
205- if (propertyBool( ' is_coremod' )) {
206- attribute_map[' FMLCorePlugin' ] = propertyString( ' coremod_plugin_class_name' )
207- if (propertyBool( ' coremod_includes_mod' )) {
184+ if (is_coremod. toBoolean( )) {
185+ attribute_map[' FMLCorePlugin' ] = coremod_plugin_class_name
186+ if (coremod_includes_mod. toBoolean( )) {
208187 attribute_map[' FMLCorePluginContainsFMLMod' ] = true
209188 }
210189 }
211- if (propertyBool( ' use_access_transformer' )) {
212- attribute_map[' FMLAT' ] = propertyString( ' access_transformer_locations' )
190+ if (use_access_transformer. toBoolean( )) {
191+ attribute_map[' FMLAT' ] = access_transformer_locations
213192 }
214193 attributes(attribute_map)
215194 }
@@ -219,6 +198,7 @@ jar {
219198
220199
221200shadowJar {
201+ // noinspection GroovyAssignabilityCheck,GroovyAccessibility
222202 configurations = [project. configurations. shadow]
223203 archiveClassifier = " shadow"
224204}
@@ -234,15 +214,15 @@ tasks.named(remapTaskName).configure {
234214}
235215
236216compileTestJava {
237- sourceCompatibility = targetCompatibility = JavaVersion . VERSION_21
217+ sourceCompatibility = targetCompatibility = JavaVersion . VERSION_25
238218}
239219
240220test {
241221 useJUnitPlatform()
242222 javaLauncher. set(javaToolchains. launcherFor {
243223 languageVersion = JavaLanguageVersion . of(25 )
244224 })
245- if (propertyBool( ' show_testing_output' )) {
225+ if (show_testing_output. toBoolean( )) {
246226 testLogging {
247227 showStandardStreams = true
248228 }
0 commit comments