Skip to content

Commit 7e5b6b6

Browse files
committed
rework common and shadowBundle
1 parent d6518b2 commit 7e5b6b6

File tree

17 files changed

+38
-51
lines changed

17 files changed

+38
-51
lines changed

base/fabric/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import net.fabricmc.loom.util.ModPlatform
1+
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
22

33
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")
44

55
base.archivesName = rootProject.name + "-base"
66

77
kessoku {
8-
common("base", ModPlatform.FABRIC)
9-
shadowBundle("base", ModPlatform.FABRIC)
8+
common("base", PlatformIdentifier.FABRIC)
9+
shadowBundle("base", PlatformIdentifier.FABRIC)
1010
}

base/neo/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import net.fabricmc.loom.util.ModPlatform
1+
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
22

33
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")
44

55
base.archivesName = rootProject.name + "-base"
66

77
kessoku {
8-
common("base", ModPlatform.NEOFORGE)
9-
shadowBundle("base", ModPlatform.NEOFORGE)
8+
common("base", PlatformIdentifier.NEO)
9+
shadowBundle("base", PlatformIdentifier.NEO)
1010
}

buildSrc/src/main/java/band/kessoku/scripts/gradle/plugin/KessokuExtension.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void moduleIncludes(List<String> names, PlatformIdentifier platform) {
7777
});
7878
}
7979

80-
public void common(String name, ModPlatform platform) {
80+
public void common(String name, PlatformIdentifier platform) {
8181
Project project = this.getProject();
8282
DependencyHandler dependencies = project.getDependencies();
8383

@@ -88,16 +88,16 @@ public void common(String name, ModPlatform platform) {
8888
dependency.setTransitive(false);
8989
dependencies.add("compileOnly", dependency);
9090
dependencies.add("runtimeOnly", dependency);
91-
dependencies.add("development" + platform.displayName(), dependency);
91+
dependencies.add("development" + platform.platform().displayName(), dependency);
9292
}
9393

94-
public void shadowBundle(String name, ModPlatform platform) {
94+
public void shadowBundle(String name, PlatformIdentifier platform) {
9595
Project project = this.getProject();
9696
DependencyHandler dependencies = project.getDependencies();
9797

9898
Dependency dependency = dependencies.project(Map.of(
9999
"path", ":" + name + "-common",
100-
"configuration", "transformProduction" + platform.displayName()
100+
"configuration", "transformProduction" + platform.platform().displayName()
101101
));
102102
dependencies.add("shade", dependency);
103103
}

command/fabric/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")
54

@@ -8,6 +7,6 @@ base.archivesName = rootProject.name + "-command"
87
kessoku {
98
modules(["base"], PlatformIdentifier.COMMON)
109

11-
common("command", ModPlatform.FABRIC)
12-
shadowBundle("command", ModPlatform.FABRIC)
10+
common("command", PlatformIdentifier.FABRIC)
11+
shadowBundle("command", PlatformIdentifier.FABRIC)
1312
}

command/neo/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")
54

@@ -9,6 +8,6 @@ kessoku {
98
modules(["base"], PlatformIdentifier.COMMON)
109
modules(["base"], PlatformIdentifier.NEO)
1110

12-
common("command", ModPlatform.NEOFORGE)
13-
shadowBundle("command", ModPlatform.NEOFORGE)
11+
common("command", PlatformIdentifier.NEO)
12+
shadowBundle("command", PlatformIdentifier.NEO)
1413
}

config/fabric/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")
54

@@ -8,8 +7,8 @@ base.archivesName = rootProject.name + "-config"
87
kessoku {
98
modules(["base", "platform"], PlatformIdentifier.COMMON)
109

11-
common("config", ModPlatform.FABRIC)
12-
shadowBundle("config", ModPlatform.FABRIC)
10+
common("config", PlatformIdentifier.FABRIC)
11+
shadowBundle("config", PlatformIdentifier.FABRIC)
1312
}
1413

1514
dependencies {

config/neo/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")
54

@@ -8,8 +7,8 @@ base.archivesName = rootProject.name + "-config"
87
kessoku {
98
modules(["base", "platform"], PlatformIdentifier.COMMON)
109

11-
common("config", ModPlatform.NEOFORGE)
12-
shadowBundle("config", ModPlatform.NEOFORGE)
10+
common("config", PlatformIdentifier.NEO)
11+
shadowBundle("config", PlatformIdentifier.NEO)
1312
}
1413

1514
dependencies {

entrypoint/fabric/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")
54

@@ -8,8 +7,8 @@ base.archivesName = rootProject.name + "-entrypoint"
87
kessoku {
98
modules(["base"], PlatformIdentifier.COMMON)
109

11-
common("entrypoint", ModPlatform.FABRIC)
12-
shadowBundle("entrypoint", ModPlatform.FABRIC)
10+
common("entrypoint", PlatformIdentifier.FABRIC)
11+
shadowBundle("entrypoint", PlatformIdentifier.FABRIC)
1312
}
1413

1514
dependencies {

entrypoint/neo/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-neo.gradle")
54

@@ -8,6 +7,6 @@ base.archivesName = rootProject.name + "-entrypoint"
87
kessoku {
98
modules(["base"], PlatformIdentifier.COMMON)
109

11-
common("entrypoint", ModPlatform.NEOFORGE)
12-
shadowBundle("entrypoint", ModPlatform.NEOFORGE)
10+
common("entrypoint",PlatformIdentifier.NEO)
11+
shadowBundle("entrypoint", PlatformIdentifier.NEO)
1312
}

event/fabric/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import band.kessoku.scripts.gradle.plugin.PlatformIdentifier
2-
import net.fabricmc.loom.util.ModPlatform
32

43
apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")
54

@@ -8,6 +7,6 @@ base.archivesName = rootProject.name + "-event"
87
kessoku {
98
modules(["base"], PlatformIdentifier.COMMON)
109

11-
common("event", ModPlatform.FABRIC)
12-
shadowBundle("event", ModPlatform.FABRIC)
10+
common("event", PlatformIdentifier.FABRIC)
11+
shadowBundle("event", PlatformIdentifier.FABRIC)
1312
}

0 commit comments

Comments
 (0)