Skip to content

Commit

Permalink
rework gradle script (klib-script-v1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Aug 20, 2024
1 parent e39c692 commit d01d3d3
Show file tree
Hide file tree
Showing 168 changed files with 86 additions and 67 deletions.
2 changes: 1 addition & 1 deletion base-common/build.gradle → base/common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.base"
base.archivesName = rootProject.name + "-base"
File renamed without changes
2 changes: 1 addition & 1 deletion base-fabric/build.gradle → base/fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.base"
base.archivesName = rootProject.name + "-base"
Expand Down
2 changes: 1 addition & 1 deletion base-neo/build.gradle → base/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.base"
base.archivesName = rootProject.name + "-base"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subprojects {
assemble.dependsOn spotlessApply

repositories {

maven { url "https://maven.neoforged.net/releases/" }
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.command"
base.archivesName = rootProject.name + "-command"
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.command"
base.archivesName = rootProject.name + "-command"
Expand Down
2 changes: 1 addition & 1 deletion command-neo/build.gradle → command/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.command"
base.archivesName = rootProject.name + "-command"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion config-common/build.gradle → config/common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.config"
base.archivesName = rootProject.name + "-config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String getFileExtension() {
}

@Override
public void serialize(Config config, OutputStream to) throws IOException {
public void serialize(Config config, OutputStream to) {
this.writer.write(write(config, createUncommentedConfig(), config.nodes()), to);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
public final class ModConfigHelperImpl {
private static ConfigEnvironment ENV;
private static final Path CONFIG_DIR = ModLoader.getInstance().getConfigFolder();
private static final Logger LOGGER = ModUtils.getLogger();

public static void init() {
Map<String, Serializer> serializerMap = new LinkedHashMap<>();
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion config-fabric/build.gradle → config/fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.config"
base.archivesName = rootProject.name + "-config"
Expand Down
2 changes: 1 addition & 1 deletion config-neo/build.gradle → config/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.config"
base.archivesName = rootProject.name + "-config"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.event"
base.archivesName = rootProject.name + "-event-base"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.event"
base.archivesName = rootProject.name + "-event-base"

dependencies {
moduleImplementation(project(":base-common"))

common(project(path: ':event-base-common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':event-base-common', configuration: 'transformProductionFabric')
}
3 changes: 2 additions & 1 deletion event-base-neo/build.gradle → event-base/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.event"
base.archivesName = rootProject.name + "-event-base"

dependencies {
moduleImplementation(project(":base-common"))

common(project(path: ':event-base-common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':event-base-common', configuration: 'transformProductionNeoForge')
}
File renamed without changes.
12 changes: 0 additions & 12 deletions fabric/build.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true
#fabric.loom.multiProjectOptimisation=true
2 changes: 1 addition & 1 deletion gradle/example/common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.package"
base.archivesName = rootProject.name + "-package"
Expand Down
2 changes: 1 addition & 1 deletion gradle/example/fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.package"
base.archivesName = rootProject.name + "-package"
Expand Down
2 changes: 1 addition & 1 deletion gradle/example/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.package"
base.archivesName = rootProject.name + "-package"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ architectury {

dependencies {
modImplementation libs.fabric.loader
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ shadowJar {

remapJar {
inputFile.set shadowJar.archiveFile
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ shadowJar {

remapJar {
inputFile.set shadowJar.archiveFile
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.keybind"
base.archivesName = rootProject.name + "-keybind"
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.keybind"
base.archivesName = rootProject.name + "-keybind"
Expand Down
2 changes: 1 addition & 1 deletion keybind-neo/build.gradle → keybind/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.keybind"
base.archivesName = rootProject.name + "-keybind"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.events.lifecycle"
base.archivesName = rootProject.name + "-lifecycle-events"
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.events.lifecycle"
base.archivesName = rootProject.name + "-lifecycle-events"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.events.lifecycle"
base.archivesName = rootProject.name + "-lifecycle-events"
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions neo/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.platform"
base.archivesName = rootProject.name + "-platform"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.platform"
base.archivesName = rootProject.name + "-platform"
Expand Down
2 changes: 1 addition & 1 deletion platform-neo/build.gradle → platform/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.platform"
base.archivesName = rootProject.name + "-platform"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-common.gradle")
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

group = "band.kessoku.lib.registry"
base.archivesName = rootProject.name + "-registry"
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-fabric.gradle")
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib.registry"
base.archivesName = rootProject.name + "-registry"
Expand Down
2 changes: 1 addition & 1 deletion registry-neo/build.gradle → registry/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: rootProject.file("gradle/scripts/kessokulib-neo.gradle")
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib.registry"
base.archivesName = rootProject.name + "-registry"
Expand Down
File renamed without changes.
36 changes: 27 additions & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,31 @@ pluginManagement {

rootProject.name = 'kessoku-lib'

include("fabric", "neo") // Bundle modules
include("base-common", "base-fabric", "base-neo") // Base
include("event-base-common", "event-base-fabric", "event-base-neo") // Event Base
include("platform-common", "platform-fabric", "platform-neo") // Platform
include("registry-common", "registry-fabric", "registry-neo") // Registry
include("lifecycle-events-common", "lifecycle-events-fabric", "lifecycle-events-neo") // Lifecycle Events
include("command-common", "command-fabric", "command-neo") // Command API
include("keybind-common", "keybind-fabric", "keybind-neo") // Keybind API
include("config-common", "config-fabric", "config-neo") // Config API
includeWrapper("fabric")
includeWrapper("neo")

includeModule("base") // Base
includeModule("event-base") // Event Base
includeModule("platform") // Platform
includeModule("registry") // Registry
includeModule("lifecycle-events") // Lifecycle Events
includeModule("command") // Command API
includeModule("keybind") // Keybind API
includeModule("config") // Config API


void includeWrapper(String platform) {
include("wrapper/$platform")
project(":wrapper/$platform").name = "$rootProject.name-$platform"
}

void includeModule(String moduleName) {
includePlatform(moduleName, "common")
includePlatform(moduleName, "fabric")
includePlatform(moduleName, "neo")
}

void includePlatform(String moduleName, String platform) {
include("$moduleName/$platform")
project(":$moduleName/$platform").name = "$moduleName-$platform"
}
12 changes: 12 additions & 0 deletions wrapper/fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

group = "band.kessoku.lib"
base.archivesName = rootProject.name

var modules = ["base", "event-base", "lifecycle-events", "platform", "registry"]

dependencies {
//modules.each {
// moduleInclude(project, "$it", "fabric")
//}
}
File renamed without changes.
File renamed without changes
12 changes: 12 additions & 0 deletions wrapper/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

group = "band.kessoku.lib"
base.archivesName = rootProject.name

var modules = ["base", "event-base", "lifecycle-events", "platform", "registry"]

dependencies {
//modules.each {
// moduleInclude(project, "$it", "neo")
//}
}
File renamed without changes.
File renamed without changes

0 comments on commit d01d3d3

Please sign in to comment.