@@ -4,45 +4,32 @@ plugins {
44 id ' maven-publish'
55 id ' com.gradleup.shadow' version ' 9.4.1'
66 id ' org.jetbrains.gradle.plugin.idea-ext' version ' 1.4.1'
7- id ' xyz.wagyourtail.unimined' version ' 1.4.18 -kappa'
7+ id ' xyz.wagyourtail.unimined' version ' 1.4.23 -kappa'
88 id ' net.kyori.blossom' version ' 2.2.0'
99}
1010
1111import org.jetbrains.gradle.ext.Gradle
1212
13- apply from : ' gradle/scripts/helpers.gradle'
14-
15- // Early Assertions
16- assertProperty ' mod_version'
17- assertProperty ' root_package'
18- assertProperty ' mod_id'
19- assertProperty ' mod_name'
20-
21- assertSubProperties ' use_access_transformer' , ' access_transformer_locations'
22- assertSubProperties ' is_coremod' , ' coremod_includes_mod' , ' coremod_plugin_class_name'
23- assertSubProperties ' use_asset_mover' , ' asset_mover_version'
24-
25- setDefaultProperty ' generate_sources_jar' , true , false
26- setDefaultProperty ' generate_javadocs_jar' , true , false
27- setDefaultProperty ' minecraft_username' , true , ' Developer'
28- setDefaultProperty ' extra_jvm_args' , false , ' '
13+ ext {
14+ // noinspection GroovyAssignabilityCheck
15+ access_transformer_locations = " ${ mod_id} _at.cfg"
16+ }
2917
30- version = propertyString( ' mod_version' )
31- group = propertyString( ' root_package' )
18+ version = mod_version
19+ group = root_package
3220
3321base {
34- archivesName = propertyString( ' mod_id' )
22+ archivesName = mod_id
3523}
3624
37-
3825java {
3926 toolchain {
4027 languageVersion = JavaLanguageVersion . of(25 )
4128 }
42- if (propertyBool( ' generate_sources_jar' )) {
29+ if (generate_sources_jar. toBoolean( )) {
4330 withSourcesJar()
4431 }
45- if (propertyBool( ' generate_javadocs_jar' )) {
32+ if (generate_javadocs_jar. toBoolean( )) {
4633 withJavadocJar()
4734 }
4835}
@@ -56,8 +43,9 @@ configurations {
5643 runtimeOnly. extendsFrom(modRuntimeOnly)
5744}
5845
59- String remapTaskName = propertyBool( ' enable_shadow' ) ? " remapShadowJar" : " remapJar"
46+ def remapTaskName = enable_shadow. toBoolean( ) ? " remapShadowJar" : " remapJar"
6047
48+ // noinspection GroovyAssignabilityCheck
6149unimined. minecraft {
6250 version " 1.12.2"
6351
@@ -66,31 +54,31 @@ unimined.minecraft {
6654 }
6755
6856 cleanroom {
69- if (propertyBool( ' use_access_transformer' )) {
70- accessTransformer " ${ rootProject.projectDir} /src/main/resources/${ propertyString(' access_transformer_locations') } "
57+ if (use_access_transformer. toBoolean( )) {
58+ accessTransformer " ${ rootProject.projectDir} /src/main/resources/$access_transformer_locations "
7159 }
7260 loader " 0.5.12-alpha"
7361 runs. all {
7462 systemProperty(" crl.dev.mixin" , " ${ mod_id} .default.mixin.json,${ mod_id} .mod.mixin.json" )
7563 args + = [' --username' , minecraft_username]
76- def extraArgs = propertyString( ' extra_jvm_args' )
64+ def extraArgs = extra_jvm_args
7765 if (extraArgs != null && ! extraArgs. trim(). isEmpty()) {
7866 jvmArgs + = extraArgs. split { " \\ s+" }. toList()
7967 }
80- if (propertyBool( ' enable_foundation_debug' )) {
68+ if (enable_foundation_debug. toBoolean( )) {
8169 systemProperty(" foundation.dump" , " true" )
8270 systemProperty(" foundation.verbose" , " true" )
8371 }
84- if (propertyBool( ' is_coremod' )) {
85- systemProperty(" fml.coreMods.load" , propertyString( ' coremod_plugin_class_name' ) )
72+ if (is_coremod. toBoolean( )) {
73+ systemProperty(" fml.coreMods.load" , coremod_plugin_class_name)
8674 }
8775 return
8876 }
8977 }
9078
9179 defaultRemapJar = false
9280
93- String jarTaskName = propertyBool( ' enable_shadow' ) ? " shadowJar" : " jar"
81+ String jarTaskName = enable_shadow. toBoolean( ) ? " shadowJar" : " jar"
9482
9583 remap(tasks. named(jarTaskName). get()) {
9684 mixinRemap {
@@ -106,10 +94,10 @@ unimined.minecraft {
10694}
10795
10896dependencies {
109- if (propertyBool( ' use_asset_mover' )) {
110- implementation " com.cleanroommc:assetmover:${ propertyString(' asset_mover_version') } "
97+ if (use_asset_mover. toBoolean( )) {
98+ implementation " com.cleanroommc:assetmover:${ asset_mover_version} "
11199 }
112- if (propertyBool( ' enable_junit_testing' )) {
100+ if (enable_junit_testing. toBoolean( )) {
113101 testImplementation ' org.junit.jupiter:junit-jupiter:6.0.3'
114102 testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
115103 }
@@ -125,21 +113,21 @@ sourceSets {
125113 main {
126114 blossom {
127115 javaSources {
128- property(' mod_id' , propertyString( ' mod_id' ) )
129- property(' mod_name' , propertyString( ' mod_name' ) )
130- property(' mod_version' , propertyString( ' mod_version' ) )
116+ property(' mod_id' , mod_id)
117+ property(' mod_name' , mod_name)
118+ property(' mod_version' , mod_version)
131119 property(' package' , " ${ root_package} .${ mod_id} " )
132120 }
133121 resources {
134- property(' mod_id' , propertyString( ' mod_id' ) )
135- property(' mod_name' , propertyString( ' mod_name' ) )
136- property(' mod_version' , propertyString( ' mod_version' ) )
137- property(' mod_description' , propertyString( ' mod_description' ) )
138- property(' mod_authors' , propertyStringList( ' mod_authors ' , ' , ' ) . collect {it. strip()}. join(' ", " ' ))
139- property(' mod_credits' , propertyString( ' mod_credits' ) )
140- property(' mod_url' , propertyString( ' mod_url' ) )
141- property(' mod_update_json' , propertyString( ' mod_update_json' ) )
142- property(' mod_logo_path' , propertyString( ' mod_logo_path' ) )
122+ property(' mod_id' , mod_id)
123+ property(' mod_name' , mod_name)
124+ property(' mod_version' , mod_version)
125+ property(' mod_description' , mod_description)
126+ property(' mod_authors' , mod_authors . toString() . split( ' , ' ) . findAll { ! it . isBlank() } . collect { " \" ${ it.strip()} \" " } . join(' , ' ))
127+ property(' mod_credits' , mod_credits)
128+ property(' mod_url' , mod_url)
129+ property(' mod_update_json' , mod_update_json)
130+ property(' mod_logo_path' , mod_logo_path)
143131 }
144132 }
145133 }
@@ -166,20 +154,20 @@ idea {
166154 afterEvaluate {
167155 javacAdditionalOptions = ' -encoding utf8'
168156 moduleJavacAdditionalOptions = [
169- (project. name + ' .main' ): tasks. compileJava. options. compilerArgs. collect { ' " ' + it + ' " ' }. join(' ' )
157+ (project. name + ' .main' ): tasks. compileJava. options. compilerArgs. collect { " \" ${ it } \" " }. join(' ' )
170158 ]
171159 }
172160 }
173161 }
174162 }
175163}
176164
177- if (! propertyBool( ' enable_shadow' )) {
165+ if (! enable_shadow. toBoolean( )) {
178166 shadowJar. enabled = false
179167}
180168
181169compileJava {
182- sourceCompatibility = targetCompatibility = JavaVersion . VERSION_21
170+ sourceCompatibility = targetCompatibility = JavaVersion . VERSION_25
183171}
184172
185173jar {
@@ -199,14 +187,14 @@ jar {
199187 attribute_map[' ContainedDeps' ] = configurations. contain. collect { it. name }. join(' ' )
200188 attribute_map[' NonModDeps' ] = true
201189 }
202- if (propertyBool( ' is_coremod' )) {
203- attribute_map[' FMLCorePlugin' ] = propertyString( ' coremod_plugin_class_name' )
204- if (propertyBool( ' coremod_includes_mod' )) {
190+ if (is_coremod. toBoolean( )) {
191+ attribute_map[' FMLCorePlugin' ] = coremod_plugin_class_name
192+ if (coremod_includes_mod. toBoolean( )) {
205193 attribute_map[' FMLCorePluginContainsFMLMod' ] = true
206194 }
207195 }
208- if (propertyBool( ' use_access_transformer' )) {
209- attribute_map[' FMLAT' ] = propertyString( ' access_transformer_locations' )
196+ if (use_access_transformer. toBoolean( )) {
197+ attribute_map[' FMLAT' ] = access_transformer_locations
210198 }
211199 attributes(attribute_map)
212200 }
@@ -216,6 +204,7 @@ jar {
216204
217205
218206shadowJar {
207+ // noinspection GroovyAssignabilityCheck,GroovyAccessibility
219208 configurations = [project. configurations. shadow]
220209 archiveClassifier = " shadow"
221210}
@@ -231,15 +220,15 @@ tasks.named(remapTaskName).configure {
231220}
232221
233222compileTestJava {
234- sourceCompatibility = targetCompatibility = JavaVersion . VERSION_21
223+ sourceCompatibility = targetCompatibility = JavaVersion . VERSION_25
235224}
236225
237226test {
238227 useJUnitPlatform()
239228 javaLauncher. set(javaToolchains. launcherFor {
240229 languageVersion = JavaLanguageVersion . of(25 )
241230 })
242- if (propertyBool( ' show_testing_output' )) {
231+ if (show_testing_output. toBoolean( )) {
243232 testLogging {
244233 showStandardStreams = true
245234 }
0 commit comments