@@ -14,28 +14,28 @@ if (gui) {
1414}
1515
1616dependencies {
17- minecraft(" com.mojang:minecraft: ${rootProject.property( " minecraft_version " )} " )
17+ minecraft(libs.fabricMinecraft )
1818 mappings(loom.officialMojangMappings())
19- modImplementation(" net.fabricmc:fabric-loader: ${rootProject.property( " loader_version " )} " )
20- testImplementation(" net.fabricmc:fabric-loader-junit: ${rootProject.property( " loader_version " )} " )
19+ modImplementation(libs.fabricLoader )
20+ testImplementation(libs.fabricLoader.junit )
2121
2222 runtimeOnly(rootProject.sourceSets.main.get().output)
2323 shadow(project(" :" ))
2424 compileOnly(project(" :" ))
2525
26- libs(" ca.spottedleaf: concurrentutil: ${rootProject.property( " concurrentutil_version " )} " ) { isTransitive = false }
27- libs(" ca.spottedleaf: yamlconfig: ${rootProject.property( " yamlconfig_version " )} " ) { isTransitive = false }
28- libs(" org.yaml: snakeyaml: ${rootProject.property( " snakeyaml_version " )} " )
26+ libs(libs. concurrentutil) { isTransitive = false }
27+ libs(libs. yamlconfig) { isTransitive = false }
28+ libs(libs. snakeyaml)
2929
3030 if (gui) {
3131 add(" guiCompileOnly" , project(" :" ))
3232 runtimeOnly(sourceSets.named(" gui" ).get().output)
3333 shadow(sourceSets.named(" gui" ).get().output)
34- add(" modGuiImplementation" , " me.shedaniel.cloth:cloth-config- fabric: ${rootProject.property( " cloth_version " )} " )
35- modRuntimeOnly(" me.shedaniel.cloth:cloth-config- fabric: ${rootProject.property( " cloth_version " )} " )
36- include(" me.shedaniel.cloth:cloth-config- fabric: ${rootProject.property( " cloth_version " )} " )
37- add(" modGuiImplementation" , " com.terraformersmc: modmenu: ${rootProject.property( " modmenu_version " )} " )
38- modRuntimeOnly(" com.terraformersmc: modmenu: ${rootProject.property( " modmenu_version " )} " )
34+ add(" modGuiImplementation" , libs.clothConfig. fabric)
35+ modRuntimeOnly(libs.clothConfig. fabric)
36+ include(libs.clothConfig. fabric)
37+ add(" modGuiImplementation" , libs. modmenu)
38+ modRuntimeOnly(libs. modmenu)
3939 }
4040
4141 modImplementation(platform(fabricApiLibs.bom))
@@ -56,9 +56,8 @@ if (gui) {
5656tasks.processResources {
5757 val properties = mapOf (
5858 " version" to project.version,
59- " minecraft_version" to rootProject.property(" minecraft_version" ).toString(),
60- " loader_version" to rootProject.property(" loader_version" ).toString(),
61- " mod_version" to rootProject.property(" mod_version" ).toString()
59+ " minecraft_version" to libs.versions.minecraft.get(),
60+ " loader_version" to libs.versions.fabricLoader.get(),
6261 )
6362 inputs.properties(properties)
6463 filesMatching(" fabric.mod.json" ) {
@@ -68,7 +67,6 @@ tasks.processResources {
6867
6968tasks.shadowJar {
7069 archiveClassifier.set(" dev-all" )
71- destinationDirectory.set(layout.buildDirectory.dir(" libs" ))
7270 configurations = listOf (project.configurations.getByName(" shadow" ))
7371 relocate(" ca.spottedleaf.concurrentutil" , " ca.spottedleaf.moonrise.libs.ca.spottedleaf.concurrentutil" )
7472 relocate(" ca.spottedleaf.yamlconfig" , " ca.spottedleaf.moonrise.libs.ca.spottedleaf.yamlconfig" )
@@ -119,15 +117,12 @@ tasks.test {
119117 systemProperty(" fabric.classPathGroups" , classPathGroups)
120118}
121119
122- afterEvaluate {
123- val runConfigCommon = extensions.getByType(RunConfigCommon ::class )
124- loom.runs.configureEach {
125- runConfigCommon.systemProperties.get().forEach {
126- property(it.key, it.value)
127- }
128- runConfigCommon.jvmArgs.get().forEach {
129- vmArgs.add(it)
130- }
120+ loom.runs.configureEach {
121+ runConfigCommon.systemProperties.get().forEach {
122+ property(it.key, it.value)
123+ }
124+ runConfigCommon.jvmArgs.get().forEach {
125+ vmArgs.add(it)
131126 }
132127}
133128
0 commit comments