diff --git a/build.gradle b/build.gradle index d7b4a913..3c685041 100644 --- a/build.gradle +++ b/build.gradle @@ -19,17 +19,17 @@ subprojects { assemble.dependsOn spotlessApply repositories { - maven { url "https://maven.neoforged.net/releases/" } + } dependencies { - minecraft libs.minecraft - mappings loom.layered { + minecraft(libs.minecraft) + mappings(loom.layered { mappings(variantOf(libs.yarn) { classifier("v2") }) - mappings libs.yarn.patch - } - implementation 'com.google.auto.service:auto-service-annotations:1.1.1' - annotationProcessor 'com.google.auto.service:auto-service:1.1.1' + mappings(libs.yarn.patch) + }) + implementation("com.google.auto.service:auto-service-annotations:1.1.1") + annotationProcessor("com.google.auto.service:auto-service:1.1.1") } java { @@ -72,3 +72,19 @@ subprojects { } } } + +allprojects { + configurations { + moduleImplementation { + canBeResolved = true + canBeConsumed = false + } + compileClasspath.extendsFrom moduleImplementation + runtimeClasspath.extendsFrom moduleImplementation + moduleInclude { + canBeResolved = true + canBeConsumed = false + } + include.extendsFrom moduleInclude + } +} diff --git a/command-common/build.gradle b/command-common/build.gradle index 685b1473..b43f152d 100644 --- a/command-common/build.gradle +++ b/command-common/build.gradle @@ -4,6 +4,6 @@ group = "band.kessoku.lib.command" base.archivesName = rootProject.name + "-command" dependencies { - implementation(project(":base-common")) - implementation(project(":event-base-common")) + moduleImplementation(project(":base-common")) + moduleImplementation(project(":event-base-common")) } \ No newline at end of file diff --git a/command-fabric/build.gradle b/command-fabric/build.gradle index d8cf2ece..57277e56 100644 --- a/command-fabric/build.gradle +++ b/command-fabric/build.gradle @@ -4,7 +4,7 @@ group = "band.kessoku.lib.command" base.archivesName = rootProject.name + "-command" dependencies { - implementation(project(":event-base-common")) + moduleImplementation(project(":event-base-common")) common(project(path: ':command-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':command-common', configuration: 'transformProductionFabric') diff --git a/command-neo/build.gradle b/command-neo/build.gradle index abcc0597..f7eb179c 100644 --- a/command-neo/build.gradle +++ b/command-neo/build.gradle @@ -4,8 +4,8 @@ group = "band.kessoku.lib.command" base.archivesName = rootProject.name + "-command" dependencies { - implementation(project(":event-base-common")) - implementation(project(":event-base-neo")) + moduleImplementation(project(":event-base-common")) + moduleImplementation(project(":event-base-neo")) common(project(path: ':command-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':command-common', configuration: 'transformProductionNeoForge') diff --git a/event-base-common/build.gradle b/event-base-common/build.gradle index 3fd06de1..d8fb41dd 100644 --- a/event-base-common/build.gradle +++ b/event-base-common/build.gradle @@ -4,5 +4,5 @@ group = "band.kessoku.lib.event" base.archivesName = rootProject.name + "-event-base" dependencies { - implementation(project(":base-common")) + moduleImplementation(project(":base-common")) } \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 55657002..1ea9c09c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -3,9 +3,10 @@ apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib" base.archivesName = rootProject.name +var modules = [":base-fabric", ":event-base-fabric", ":lifecycle-events-fabric", ":platform-fabric", ":registry-fabric"] + dependencies { - include(project(":base-fabric")) - include(project(":event-base-fabric")) - include(project(":platform-fabric")) - include(project(":registry-fabric")) + modules.each { + moduleInclude(project(it)) + } } diff --git a/gradle/example/common/build.gradle b/gradle/example/common/build.gradle new file mode 100644 index 00000000..91d13986 --- /dev/null +++ b/gradle/example/common/build.gradle @@ -0,0 +1,9 @@ +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") + +group = "band.kessoku.lib.package" +base.archivesName = rootProject.name + "-package" + +// You can delete this section if you need to +dependencies { + +} diff --git a/gradle/example/fabric/build.gradle b/gradle/example/fabric/build.gradle new file mode 100644 index 00000000..0ada6be9 --- /dev/null +++ b/gradle/example/fabric/build.gradle @@ -0,0 +1,9 @@ +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") + +group = "band.kessoku.lib.package" +base.archivesName = rootProject.name + "-package" + +dependencies { + common(project(path: ':package-common', configuration: 'namedElements')) { transitive false } + shadowBundle(project(path: ':package-common', configuration: 'transformProductionFabric')) +} diff --git a/gradle/example/neo/build.gradle b/gradle/example/neo/build.gradle new file mode 100644 index 00000000..21e732ee --- /dev/null +++ b/gradle/example/neo/build.gradle @@ -0,0 +1,9 @@ +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") + +group = "band.kessoku.lib.package" +base.archivesName = rootProject.name + "-package" + +dependencies { + common(project(path: ':package-common', configuration: 'namedElements')) { transitive false } + shadowBundle(project(path: ':package-common', configuration: 'transformProductionNeoForge')) +} diff --git a/gradle/example/neo/gradle.properties b/gradle/example/neo/gradle.properties new file mode 100644 index 00000000..2914393d --- /dev/null +++ b/gradle/example/neo/gradle.properties @@ -0,0 +1 @@ +loom.platform=neoforge \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dd6c6afa..17a0fd5b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ mod = "0.1.0" minecraft = "1.21" yarn = "1.21+build.9" -yarn-mappings-patch-neoforge = "1.21+build.4" +yarn-patch-neoforge = "1.21+build.4" # Loaders neo = "21.0.151" @@ -10,10 +10,17 @@ fabric-loader = "0.16.0" # Mods fabric-api = "0.100.8+1.21" + +# Plugin version +loom = "1.7-SNAPSHOT" +architectury = "3.4-SNAPSHOT" +shadow = "8.1.1" +spotless = "6.25.0" + [libraries] minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" } yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" } -yarn-patch = { group = "dev.architectury", name = "yarn-mappings-patch-neoforge", version.ref = "yarn-mappings-patch-neoforge" } +yarn-patch = { group = "dev.architectury", name = "yarn-mappings-patch-neoforge", version.ref = "yarn-patch-neoforge" } # Loaders neo = { group = "net.neoforged", name = "neoforge", version.ref = "neo" } @@ -21,8 +28,9 @@ fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = # Mods fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api" } + [plugins] -loom = { id = "dev.architectury.loom", version = "1.7-SNAPSHOT" } -architectury = { id = "architectury-plugin", version = "3.4-SNAPSHOT" } -shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" } -spotless = { id = "com.diffplug.spotless", version = "6.25.0" } \ No newline at end of file +loom = { id = "dev.architectury.loom", version.ref = "loom" } +architectury = { id = "architectury-plugin", version.ref = "architectury" } +shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } \ No newline at end of file diff --git a/lifecycle-events-common/build.gradle b/lifecycle-events-common/build.gradle index 6782a733..994ee90b 100644 --- a/lifecycle-events-common/build.gradle +++ b/lifecycle-events-common/build.gradle @@ -4,6 +4,6 @@ group = "band.kessoku.lib.events.lifecycle" base.archivesName = rootProject.name + "-lifecycle-events" dependencies { - implementation(project(":base-common")) - implementation(project(":event-base-common")) + moduleImplementation(project(":base-common")) + moduleImplementation(project(":event-base-common")) } \ No newline at end of file diff --git a/lifecycle-events-fabric/build.gradle b/lifecycle-events-fabric/build.gradle index 36e4aa22..afa73ea6 100644 --- a/lifecycle-events-fabric/build.gradle +++ b/lifecycle-events-fabric/build.gradle @@ -4,7 +4,7 @@ group = "band.kessoku.lib.events.lifecycle" base.archivesName = rootProject.name + "-lifecycle-events" dependencies { - implementation(project(":event-base-common")) + moduleImplementation(project(":event-base-common")) common(project(path: ':lifecycle-events-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':lifecycle-events-common', configuration: 'transformProductionFabric') diff --git a/lifecycle-events-neo/build.gradle b/lifecycle-events-neo/build.gradle index 0051f405..46539657 100644 --- a/lifecycle-events-neo/build.gradle +++ b/lifecycle-events-neo/build.gradle @@ -10,8 +10,8 @@ loom { } dependencies { - implementation(project(":event-base-common")) - implementation(project(":event-base-neo")) + moduleImplementation(project(":event-base-common")) + moduleImplementation(project(":event-base-neo")) common(project(path: ':lifecycle-events-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':lifecycle-events-common', configuration: 'transformProductionNeoForge') diff --git a/neo/build.gradle b/neo/build.gradle index f70c16fb..b12d77c8 100644 --- a/neo/build.gradle +++ b/neo/build.gradle @@ -3,9 +3,10 @@ apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib" base.archivesName = rootProject.name +var modules = [":base-neo", ":event-base-neo", ":lifecycle-events-neo", ":platform-neo", ":registry-neo"] + dependencies { - include(project(":base-neo")) - include(project(":event-base-neo")) - include(project(":platform-neo")) - include(project(":registry-neo")) + modules.each { + moduleInclude(project(it)) + } } diff --git a/platform-common/build.gradle b/platform-common/build.gradle index 5417392b..bc1382ff 100644 --- a/platform-common/build.gradle +++ b/platform-common/build.gradle @@ -4,5 +4,5 @@ group = "band.kessoku.lib.platform" base.archivesName = rootProject.name + "-platform" dependencies { - implementation(project(":base-common")) + moduleImplementation(project(":base-common")) } \ No newline at end of file diff --git a/platform-fabric/build.gradle b/platform-fabric/build.gradle index eacc011f..bc9b9663 100644 --- a/platform-fabric/build.gradle +++ b/platform-fabric/build.gradle @@ -5,5 +5,5 @@ base.archivesName = rootProject.name + "-platform" dependencies { common(project(path: ':platform-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':platform-common', configuration: 'transformProductionFabric') + shadowBundle(project(path: ':platform-common', configuration: 'transformProductionFabric')) } diff --git a/platform-neo/build.gradle b/platform-neo/build.gradle index 85ef781f..bb815788 100644 --- a/platform-neo/build.gradle +++ b/platform-neo/build.gradle @@ -5,5 +5,5 @@ base.archivesName = rootProject.name + "-platform" dependencies { common(project(path: ':platform-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':platform-common', configuration: 'transformProductionNeoForge') + shadowBundle(project(path: ':platform-common', configuration: 'transformProductionNeoForge')) } diff --git a/registry-common/build.gradle b/registry-common/build.gradle index a9d11490..50bb1128 100644 --- a/registry-common/build.gradle +++ b/registry-common/build.gradle @@ -4,5 +4,5 @@ group = "band.kessoku.lib.registry" base.archivesName = rootProject.name + "-registry" dependencies { - implementation project(":base-common") + moduleImplementation(project(":base-common")) } \ No newline at end of file diff --git a/registry-fabric/build.gradle b/registry-fabric/build.gradle index 0af45533..47ca80d1 100644 --- a/registry-fabric/build.gradle +++ b/registry-fabric/build.gradle @@ -5,5 +5,5 @@ base.archivesName = rootProject.name + "-registry" dependencies { common(project(path: ':registry-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':registry-common', configuration: 'transformProductionFabric') + shadowBundle(project(path: ':registry-common', configuration: 'transformProductionFabric')) } diff --git a/registry-neo/build.gradle b/registry-neo/build.gradle index 514f5701..dd48c309 100644 --- a/registry-neo/build.gradle +++ b/registry-neo/build.gradle @@ -4,8 +4,8 @@ group = "band.kessoku.lib.registry" base.archivesName = rootProject.name + "-registry" dependencies { - implementation(project(":event-base-neo")) + moduleImplementation(project(":event-base-neo")) common(project(path: ':registry-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':registry-common', configuration: 'transformProductionNeoForge') + shadowBundle(project(path: ':registry-common', configuration: 'transformProductionNeoForge')) }