Skip to content

Commit

Permalink
Merge pull request #4 from KessokuTeaTime/new-script/1.21
Browse files Browse the repository at this point in the history
rework gradle script
  • Loading branch information
TexBlock authored Aug 5, 2024
2 parents f19356e + e410140 commit 8525d2d
Show file tree
Hide file tree
Showing 29 changed files with 239 additions and 709 deletions.
16 changes: 3 additions & 13 deletions base-common/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
group = "band.kessoku.lib.base"
base.archivesName = rootProject.name + "-base"
48 changes: 2 additions & 46 deletions base-fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
51 changes: 2 additions & 49 deletions base-neo/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
30 changes: 23 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}
17 changes: 5 additions & 12 deletions command-common/build.gradle
Original file line number Diff line number Diff line change
@@ -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"))
}
51 changes: 3 additions & 48 deletions command-fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
56 changes: 4 additions & 52 deletions command-neo/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
15 changes: 4 additions & 11 deletions event-base-common/build.gradle
Original file line number Diff line number Diff line change
@@ -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"))
}
Loading

0 comments on commit 8525d2d

Please sign in to comment.