11val forgeVersion = property(" forge_version" ).toString()
2- val kotlinForgeVersion = property(" kotlin_forge_version" ).toString()
32val architecturyVersion = property(" architectury_version" ).toString()
43val mixinExtrasVersion = property(" mixinextras_version" ).toString()
4+ val kotlinForgeVersion = property(" kotlin_forge_version" ).toString()
55
66architectury {
77 platformSetupLoomIde()
@@ -18,23 +18,11 @@ loom {
1818 extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name)
1919 mixinConfig(" lambda.mixins.common.json" )
2020 }
21-
22- mods {
23- register(" forge" ) {
24- sourceSet(" main" , project(" :forge" ))
25-
26- sourceSets.forEach {
27- val dir = layout.buildDirectory.dir(" sourcesSets/${it.name} " )
28- it.output.setResourcesDir(dir)
29- it.java.destinationDirectory.set(dir)
30- }
31- }
32- }
3321}
3422
3523repositories {
36- maven(" https://thedarkcolour.github.io/KotlinForForge/" )
3724 maven(" https://cursemaven.com" )
25+ maven(" https://thedarkcolour.github.io/KotlinForForge/" )
3826}
3927
4028val common: Configuration by configurations.creating {
@@ -45,43 +33,40 @@ val common: Configuration by configurations.creating {
4533
4634val includeLib: Configuration by configurations.creating
4735val includeMod: Configuration by configurations.creating
36+ val shadowInclude: Configuration by configurations.creating
4837
4938fun DependencyHandlerScope.setupConfigurations () {
5039 includeLib.dependencies.forEach {
51- implementation (it)
40+ forgeRuntimeLibrary (it)
5241 include(it)
5342 }
5443
55- // Please look at this before yelling at me
56- // https://docs.architectury.dev/loom/using_libraries/
5744 includeMod.dependencies.forEach {
58- implementation(it)
5945 forgeRuntimeLibrary(it)
46+ include(it)
6047 }
6148}
6249
6350dependencies {
6451 // Forge API
6552 forge(" net.minecraftforge:forge:$forgeVersion " )
6653
67- // Remove the following line if you don't want to depend on the API
68- modApi(" dev.architectury:architectury-forge:$architecturyVersion " )
69-
7054 // Add dependencies on the required Kotlin modules.
7155 includeLib(" org.reflections:reflections:0.10.2" )
72- includeLib(" org.javassist:javassist:3.27.0-GA" )
73-
74- implementation(" io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion " )
75- compileOnly(annotationProcessor(" io.github.llamalad7:mixinextras-common:$mixinExtrasVersion " )!! )
56+ includeLib(" org.javassist:javassist:3.28.0-GA" )
7657
7758 // Add mods to the mod jar
7859 includeMod(" thedarkcolour:kotlinforforge:$kotlinForgeVersion " )
7960
80- // Bugfixes
81- compileOnly(kotlin(" stdlib" )) // Hack https://github.com/thedarkcolour/KotlinForForge/issues/93
61+ // MixinExtras
62+ implementation(" io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion " )
63+ compileOnly(annotationProcessor(" io.github.llamalad7:mixinextras-common:$mixinExtrasVersion " )!! )
64+
65+ // Fix KFF
66+ compileOnly(kotlin(" stdlib" ))
8267
8368 // Common (Do not touch)
84- common(project(" :common" , configuration = " namedElements" )) { isTransitive = false } // We cannot common here because it is treated as a different mod and forge will panic
69+ common(project(" :common" , configuration = " namedElements" )) { isTransitive = false }
8570 shadowCommon(project(path = " :common" , configuration = " transformProductionForge" )) { isTransitive = false }
8671
8772 // Finish the configuration
@@ -90,11 +75,21 @@ dependencies {
9075
9176tasks {
9277 processResources {
78+ inputs.property(" group" , project.group)
9379 inputs.property(" version" , project.version)
9480
9581 filesMatching(" META-INF/mods.toml" ) {
9682 expand(getProperties())
97- expand(mutableMapOf (" version" to project.version))
83+ expand(mutableMapOf (
84+ " group" to project.group,
85+ " version" to project.version,
86+ ))
9887 }
9988 }
89+
90+ sourceSets.forEach {
91+ val dir = layout.buildDirectory.dir(" sourcesSets/${it.name} " )
92+ it.output.setResourcesDir(dir)
93+ it.java.destinationDirectory.set(dir)
94+ }
10095}
0 commit comments