11val neoVersion = property(" neo_version" ).toString()
2- val architecturyVersion = property(" architectury_version" ).toString()
32val kotlinForgeVersion = property(" kotlin_forge_version" ).toString()
43
4+ base.archivesName.set(" ${base.archivesName.get()} -neoforge" )
5+
56architectury {
67 platformSetupLoomIde()
78 neoForge()
89}
910
10- base.archivesName.set(" ${base.archivesName.get()} -neoforge" )
11-
1211loom {
1312 accessWidenerPath.set(project(" :common" ).loom.accessWidenerPath)
13+
1414 neoForge {
1515 enableTransitiveAccessWideners = true
1616 }
@@ -25,23 +25,32 @@ val common: Configuration by configurations.creating {
2525 configurations.compileClasspath.get().extendsFrom(this )
2626 configurations.runtimeClasspath.get().extendsFrom(this )
2727 configurations[" developmentNeoForge" ].extendsFrom(this )
28+ isCanBeResolved = true
29+ isCanBeConsumed = false
2830}
2931
3032val includeLib: Configuration by configurations.creating
3133val includeMod: Configuration by configurations.creating
34+ val shadowBundle: Configuration by configurations.creating {
35+ isCanBeResolved = true
36+ isCanBeConsumed = false
37+ }
3238
3339fun DependencyHandlerScope.setupConfigurations () {
3440 includeLib.dependencies.forEach {
3541 implementation(it)
36- forgeRuntimeLibrary(it)
3742 include(it)
3843 }
3944
4045 includeMod.dependencies.forEach {
4146 implementation(it)
42- forgeRuntimeLibrary(it)
4347 include(it)
4448 }
49+
50+ shadowBundle.dependencies.forEach {
51+ shadowCommon(it)
52+ shadow(it)
53+ }
4554}
4655
4756dependencies {
@@ -57,34 +66,20 @@ dependencies {
5766
5867 // Common (Do not touch)
5968 common(project(" :common" , configuration = " namedElements" )) { isTransitive = false }
60- shadowCommon (project(path = " :common" , configuration = " transformProductionNeoForge" )) { isTransitive = false }
69+ shadowBundle (project(path = " :common" , configuration = " transformProductionNeoForge" ))
6170
6271 // Finish the configuration
6372 setupConfigurations()
6473}
6574
6675tasks {
67- processResources {
68- inputs.property(" group" , project.group)
69- inputs.property(" version" , project.version)
70-
71- filesMatching(" META-INF/mods.toml" ) {
72- expand(getProperties())
73- expand(mutableMapOf (
74- " group" to project.group,
75- " version" to project.version,
76- ))
77- }
78- }
79-
8076 remapJar {
81- atAccessWideners.add(" lambda.accesswidener" )
82- injectAccessWidener.set(true )
77+ injectAccessWidener = true
8378 }
8479
85- sourceSets.forEach {
86- val dir = layout.buildDirectory.dir( " sourcesSets/ ${it.name} " )
87- it.output.setResourcesDir(dir )
88- it.java.destinationDirectory.set(dir)
80+ processResources {
81+ filesMatching( " META-INF/mods.toml " ) {
82+ expand(project( " :common " ).properties )
83+ }
8984 }
9085}
0 commit comments