diff --git a/base-common/build.gradle b/base-common/build.gradle index 98e6e7f2..63d4600f 100644 --- a/base-common/build.gradle +++ b/base-common/build.gradle @@ -1,14 +1,4 @@ -group = "band.kessoku.lib.base" -version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-base" -} +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") -architectury { - common(["fabric", "neoforge"]) -} - -dependencies { - modImplementation libs.fabric.loader -} \ No newline at end of file +group = "band.kessoku.lib.base" +base.archivesName = rootProject.name + "-base" diff --git a/base-fabric/build.gradle b/base-fabric/build.gradle index 2d020901..f11196ab 100644 --- a/base-fabric/build.gradle +++ b/base-fabric/build.gradle @@ -1,53 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib.base" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-base" -} - -architectury { - platformSetupLoomIde() - fabric() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-base" dependencies { - modImplementation libs.fabric.loader - modImplementation libs.fabric.api common(project(path: ':base-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':base-common', configuration: 'transformProductionFabric') } - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/base-neo/build.gradle b/base-neo/build.gradle index 79923390..c05d9e6a 100644 --- a/base-neo/build.gradle +++ b/base-neo/build.gradle @@ -1,56 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} - -base { - archivesName = rootProject.name + "-base" -} +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib.base" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() - -architectury { - platformSetupLoomIde() - neoForge() -} - -repositories { - maven { url "https://maven.neoforged.net/releases/" } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentNeoForge.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-base" dependencies { - neoForge libs.neo common(project(path: ':base-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':base-common', configuration: 'transformProductionNeoForge') } - -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file 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 6f266c32..b43f152d 100644 --- a/command-common/build.gradle +++ b/command-common/build.gradle @@ -1,16 +1,9 @@ -group = "band.kessoku.lib.command" -version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-command_api" -} +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") -architectury { - common(["fabric", "neoforge"]) -} +group = "band.kessoku.lib.command" +base.archivesName = rootProject.name + "-command" dependencies { - modImplementation libs.fabric.loader - 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 adfafa17..57277e56 100644 --- a/command-fabric/build.gradle +++ b/command-fabric/build.gradle @@ -1,56 +1,11 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib.command" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-command_api" -} - -architectury { - platformSetupLoomIde() - fabric() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-command" dependencies { - modImplementation libs.fabric.loader - modImplementation libs.fabric.api - - 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') } - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - input.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/command-neo/build.gradle b/command-neo/build.gradle index 84906794..f7eb179c 100644 --- a/command-neo/build.gradle +++ b/command-neo/build.gradle @@ -1,60 +1,12 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib.command" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-command_api" -} - -architectury { - platformSetupLoomIde() - neoForge() -} - -repositories { - maven { url "https://maven.neoforged.net/releases/" } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentNeoForge.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-command" dependencies { - neoForge libs.neo - - 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') } - -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - input.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/event-base-common/build.gradle b/event-base-common/build.gradle index 71f49db3..d8fb41dd 100644 --- a/event-base-common/build.gradle +++ b/event-base-common/build.gradle @@ -1,15 +1,8 @@ -group = "band.kessoku.lib.event" -version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-event-base" -} +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") -architectury { - common(["fabric", "neoforge"]) -} +group = "band.kessoku.lib.event" +base.archivesName = rootProject.name + "-event-base" dependencies { - modImplementation libs.fabric.loader - implementation(project(":base-common")) + moduleImplementation(project(":base-common")) } \ No newline at end of file diff --git a/event-base-fabric/build.gradle b/event-base-fabric/build.gradle index 7ffcd497..bd0cc5b8 100644 --- a/event-base-fabric/build.gradle +++ b/event-base-fabric/build.gradle @@ -1,53 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib.event" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-event-base" -} - -architectury { - platformSetupLoomIde() - fabric() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-event-base" dependencies { - modImplementation libs.fabric.loader - modImplementation libs.fabric.api common(project(path: ':event-base-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':event-base-common', configuration: 'transformProductionFabric') } - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/event-base-neo/build.gradle b/event-base-neo/build.gradle index ad7b39dc..bff63401 100644 --- a/event-base-neo/build.gradle +++ b/event-base-neo/build.gradle @@ -1,56 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib.event" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-event-base" -} - -architectury { - platformSetupLoomIde() - neoForge() -} - -repositories { - maven { url "https://maven.neoforged.net/releases/" } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentNeoForge.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-event-base" dependencies { - neoForge libs.neo common(project(path: ':event-base-common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':event-base-common', configuration: 'transformProductionNeoForge') } - -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 7e9568a9..1ea9c09c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,28 +1,12 @@ +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") + group = "band.kessoku.lib" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() +base.archivesName = rootProject.name -base { - archivesName = rootProject.name -} - -architectury { - platformSetupLoomIde() - fabric() -} +var modules = [":base-fabric", ":event-base-fabric", ":lifecycle-events-fabric", ":platform-fabric", ":registry-fabric"] dependencies { - modImplementation libs.fabric.loader - - include(project(":base-fabric")) - include(project(":event-base-fabric")) - include(project(":platform-fabric")) - include(project(":registry-fabric")) -} - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version + modules.each { + moduleInclude(project(it)) } -} \ No newline at end of file +} 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/gradle/scripts/kessokulib-common.gradle b/gradle/scripts/kessokulib-common.gradle new file mode 100644 index 00000000..b84dcc2c --- /dev/null +++ b/gradle/scripts/kessokulib-common.gradle @@ -0,0 +1,9 @@ +version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() + +architectury { + common(["fabric", "neoforge"]) +} + +dependencies { + modImplementation libs.fabric.loader +} \ No newline at end of file diff --git a/gradle/scripts/kessokulib-fabric.gradle b/gradle/scripts/kessokulib-fabric.gradle new file mode 100644 index 00000000..13fcb319 --- /dev/null +++ b/gradle/scripts/kessokulib-fabric.gradle @@ -0,0 +1,44 @@ +apply plugin: "com.github.johnrengelman.shadow" + +version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() + +architectury { + platformSetupLoomIde() + fabric() +} + +configurations { + common { + canBeResolved = true + canBeConsumed = false + } + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentFabric.extendsFrom common + shadowBundle { + canBeResolved = true + canBeConsumed = false + } +} + +dependencies { + modImplementation libs.fabric.loader + modImplementation libs.fabric.api +} + +processResources { + inputs.property 'version', project.version + + filesMatching('fabric.mod.json') { + expand version: project.version + } +} + +shadowJar { + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' +} + +remapJar { + inputFile.set shadowJar.archiveFile +} \ No newline at end of file diff --git a/gradle/scripts/kessokulib-neo.gradle b/gradle/scripts/kessokulib-neo.gradle new file mode 100644 index 00000000..72ade128 --- /dev/null +++ b/gradle/scripts/kessokulib-neo.gradle @@ -0,0 +1,47 @@ +apply plugin: "com.github.johnrengelman.shadow" + +version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() + +architectury { + platformSetupLoomIde() + neoForge() +} + +repositories { + maven { url "https://maven.neoforged.net/releases/" } +} + +configurations { + common { + canBeResolved = true + canBeConsumed = false + } + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentNeoForge.extendsFrom common + shadowBundle { + canBeResolved = true + canBeConsumed = false + } +} + +dependencies { + neoForge libs.neo +} + +processResources { + inputs.property 'version', project.version + + filesMatching('META-INF/neoforge.mods.toml') { + expand version: project.version + } +} + +shadowJar { + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' +} + +remapJar { + input.set shadowJar.archiveFile +} \ No newline at end of file diff --git a/lifecycle-events-common/build.gradle b/lifecycle-events-common/build.gradle index 33cadd39..994ee90b 100644 --- a/lifecycle-events-common/build.gradle +++ b/lifecycle-events-common/build.gradle @@ -1,16 +1,9 @@ -group = "band.kessoku.lib.events.lifecycle" -version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-lifecycle-events" -} +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") -architectury { - common(["fabric", "neoforge"]) -} +group = "band.kessoku.lib.events.lifecycle" +base.archivesName = rootProject.name + "-lifecycle-events" dependencies { - modImplementation libs.fabric.loader - 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 07e3a804..afa73ea6 100644 --- a/lifecycle-events-fabric/build.gradle +++ b/lifecycle-events-fabric/build.gradle @@ -1,56 +1,11 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib.events.lifecycle" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-lifecycle-events" -} - -architectury { - platformSetupLoomIde() - fabric() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-lifecycle-events" dependencies { - modImplementation libs.fabric.loader - modImplementation libs.fabric.api - - 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') } - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - input.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/lifecycle-events-neo/build.gradle b/lifecycle-events-neo/build.gradle index 3279a33d..46539657 100644 --- a/lifecycle-events-neo/build.gradle +++ b/lifecycle-events-neo/build.gradle @@ -1,18 +1,7 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib.events.lifecycle" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-lifecycle-events" -} - -architectury { - platformSetupLoomIde() - neoForge() -} +base.archivesName = rootProject.name + "-lifecycle-events" loom { neoForge { @@ -20,47 +9,10 @@ loom { } } -repositories { - maven { url "https://maven.neoforged.net/releases/" } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentNeoForge.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} - dependencies { - neoForge libs.neo - - 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') } - -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - input.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/neo/build.gradle b/neo/build.gradle index 747d4aed..b12d77c8 100644 --- a/neo/build.gradle +++ b/neo/build.gradle @@ -1,26 +1,12 @@ -group = "band.kessoku.lib" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") -base { - archivesName = rootProject.name -} +group = "band.kessoku.lib" +base.archivesName = rootProject.name -architectury { - platformSetupLoomIde() - neoForge() -} +var modules = [":base-neo", ":event-base-neo", ":lifecycle-events-neo", ":platform-neo", ":registry-neo"] dependencies { - neoForge libs.neo - include(project(":base-neo")) - include(project(":event-base-neo")) - include(project(":platform-neo")) - include(project(":registry-neo")) -} -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version + modules.each { + moduleInclude(project(it)) } -} \ No newline at end of file +} diff --git a/platform-common/build.gradle b/platform-common/build.gradle index d30f4cb7..bc1382ff 100644 --- a/platform-common/build.gradle +++ b/platform-common/build.gradle @@ -1,15 +1,8 @@ -group = "band.kessoku.lib.platform" -version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-platform" -} +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") -architectury { - common(["fabric", "neoforge"]) -} +group = "band.kessoku.lib.platform" +base.archivesName = rootProject.name + "-platform" dependencies { - modImplementation libs.fabric.loader - 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 68d58a63..bc9b9663 100644 --- a/platform-fabric/build.gradle +++ b/platform-fabric/build.gradle @@ -1,53 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} - -base { - archivesName = rootProject.name + "-platform" -} +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib.platform" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() - -architectury { - platformSetupLoomIde() - fabric() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-platform" dependencies { - modImplementation libs.fabric.loader - modImplementation libs.fabric.api common(project(path: ':platform-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':platform-common', configuration: 'transformProductionFabric') + shadowBundle(project(path: ':platform-common', configuration: 'transformProductionFabric')) } - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/platform-neo/build.gradle b/platform-neo/build.gradle index 63b1e927..bb815788 100644 --- a/platform-neo/build.gradle +++ b/platform-neo/build.gradle @@ -1,52 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} - -base { - archivesName = rootProject.name + "-platform" -} +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib.platform" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() - -architectury { - platformSetupLoomIde() - neoForge() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentNeoForge.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-platform" dependencies { - neoForge libs.neo common(project(path: ':platform-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':platform-common', configuration: 'transformProductionNeoForge') + shadowBundle(project(path: ':platform-common', configuration: 'transformProductionNeoForge')) } - -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/registry-common/build.gradle b/registry-common/build.gradle index 816c03e1..50bb1128 100644 --- a/registry-common/build.gradle +++ b/registry-common/build.gradle @@ -1,15 +1,8 @@ -group = "band.kessoku.lib.registry" -version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-registry" -} +apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle") -architectury { - common(["fabric", "neoforge"]) -} +group = "band.kessoku.lib.registry" +base.archivesName = rootProject.name + "-registry" dependencies { - modImplementation libs.fabric.loader - 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 7ef21480..47ca80d1 100644 --- a/registry-fabric/build.gradle +++ b/registry-fabric/build.gradle @@ -1,53 +1,9 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} +apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle") group = "band.kessoku.lib.registry" -version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() - -base { - archivesName = rootProject.name + "-registry" -} - -architectury { - platformSetupLoomIde() - fabric() -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-registry" dependencies { - modImplementation libs.fabric.loader - modImplementation libs.fabric.api common(project(path: ':registry-common', configuration: 'namedElements')) { transitive false } - shadowBundle project(path: ':registry-common', configuration: 'transformProductionFabric') + shadowBundle(project(path: ':registry-common', configuration: 'transformProductionFabric')) } - -processResources { - inputs.property 'version', project.version - - filesMatching('fabric.mod.json') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' -} - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file diff --git a/registry-neo/build.gradle b/registry-neo/build.gradle index 7ea5bbb3..dd48c309 100644 --- a/registry-neo/build.gradle +++ b/registry-neo/build.gradle @@ -1,59 +1,11 @@ -plugins { - id 'com.github.johnrengelman.shadow' -} - -base { - archivesName = rootProject.name + "-registry" -} +apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle") group = "band.kessoku.lib.registry" -version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() - -architectury { - platformSetupLoomIde() - neoForge() -} - -repositories { - maven { url "https://maven.neoforged.net/releases/" } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentNeoForge.extendsFrom common - shadowBundle { - canBeResolved = true - canBeConsumed = false - } -} +base.archivesName = rootProject.name + "-registry" dependencies { - neoForge libs.neo - - 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') -} - -processResources { - inputs.property 'version', project.version - - filesMatching('META-INF/neoforge.mods.toml') { - expand version: project.version - } -} - -shadowJar { - configurations = [project.configurations.shadowBundle] - archiveClassifier = 'dev-shadow' + shadowBundle(project(path: ':registry-common', configuration: 'transformProductionNeoForge')) } - -remapJar { - inputFile.set shadowJar.archiveFile -} \ No newline at end of file