Skip to content

Commit bbd2083

Browse files
Merge pull request #1093 from JasperLorelai/shadowless-config-and-publish
Shadowless config and publish
2 parents b55405a + 566c60e commit bbd2083

12 files changed

Lines changed: 55 additions & 40 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ jobs:
6363
with:
6464
name: MagicSpells-${{steps.version.outputs.version}}-${{steps.hash.outputs.sha_short}}
6565
if-no-files-found: error
66-
path: core/build/libs/MagicSpells*.jar
66+
path: core/build/libs/MagicSpells-${{steps.version.outputs.version}}-${{steps.hash.outputs.sha_short}}.jar

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ repositories {
9393
}
9494
9595
dependencies {
96-
implementation("com.github.TheComputerGeek2.MagicSpells:core:main-SNAPSHOT") {transitive = false}
96+
compileOnly("com.github.TheComputerGeek2.MagicSpells:core:main-SNAPSHOT")
9797
}
9898
```
9999

‎build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ subprojects {
77
apply plugin: "dev.magicspells.msjava"
88

99
dependencies {
10-
implementation("io.papermc.paper:paper-api:26.1.2.build.+")
10+
compileOnly("io.papermc.paper:paper-api:26.1.2.build.+")
1111
}
1212

1313
processResources {

‎core/build.gradle‎

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,52 @@ plugins {
44
}
55

66
dependencies {
7-
shadow("org.apache.commons:commons-math4-core:4.0-beta1")
8-
shadow("com.github.ben-manes.caffeine:caffeine:3.2.2")
9-
shadow("com.github.Chronoken:EffectLib:1da888c")
10-
shadow("org.incendo:cloud-paper:2.0.0-beta.16")
11-
shadow("org.incendo:cloud-minecraft-extras:2.0.0-beta.16")
12-
shadow("org.incendo:cloud-processors-requirements:1.0.0-rc.1")
13-
shadow("org.bstats:bstats-bukkit:3.2.1")
14-
shadow("com.github.ezylang:EvalEx:3.6.2")
7+
implementation("org.apache.commons:commons-math4-core:4.0-beta1")
8+
implementation("com.github.ben-manes.caffeine:caffeine:3.2.2")
9+
implementation("com.github.Chronoken:EffectLib:1da888c")
10+
implementation("org.incendo:cloud-paper:2.0.0-beta.16")
11+
implementation("org.incendo:cloud-minecraft-extras:2.0.0-beta.16")
12+
implementation("org.incendo:cloud-processors-requirements:1.0.0-rc.1")
13+
implementation("org.bstats:bstats-bukkit:3.2.1")
14+
implementation("com.github.ezylang:EvalEx:3.6.2")
1515

16-
shadow("org.antlr:antlr4-runtime:4.13.2")
16+
implementation("org.antlr:antlr4-runtime:4.13.2")
1717
antlr("org.antlr:antlr4:4.13.2")
1818

19-
shadow(project(path: ":nms:shared", configuration: "apiElements"))
20-
shadow(project(path: ":nms:latest")) { transitive = false }
21-
shadow(project(path: ":nms:v26_1_2")) { transitive = false }
19+
implementation(project(path: ":nms:shared"))
20+
implementation(project(path: ":nms:latest"))
21+
implementation(project(path: ":nms:v26_1_2"))
2222

23-
implementation("com.github.retrooper:packetevents-spigot:2.11.2")
24-
implementation("net.dmulloy2:ProtocolLib:5.4.0") { transitive = false }
25-
implementation("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT") { transitive = false }
26-
implementation("net.milkbowl.vault:VaultAPI:1.7") { transitive = false }
27-
implementation("me.clip:placeholderapi:2.12.2") { transitive = false }
28-
implementation("com.github.GriefPrevention:GriefPrevention:18.0.0") { transitive = false }
29-
implementation("com.sk89q.worldguard:worldguard-core:7.1.0-SNAPSHOT") { transitive = false }
30-
implementation("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT") { transitive = false }
31-
implementation("com.sk89q.worldedit:worldedit-core:7.4.0-SNAPSHOT") { transitive = false }
32-
implementation("com.sk89q.worldedit:worldedit-bukkit:7.4.0-SNAPSHOT") { transitive = false }
23+
compileOnly("com.github.retrooper:packetevents-spigot:2.11.2")
24+
compileOnly("net.dmulloy2:ProtocolLib:5.4.0")
25+
compileOnly("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT")
26+
compileOnly("net.milkbowl.vault:VaultAPI:1.7")
27+
compileOnly("me.clip:placeholderapi:2.12.2")
28+
compileOnly("com.github.GriefPrevention:GriefPrevention:18.0.0")
29+
compileOnly("com.sk89q.worldguard:worldguard-core:7.1.0-SNAPSHOT")
30+
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT")
31+
compileOnly("com.sk89q.worldedit:worldedit-core:7.4.0-SNAPSHOT")
32+
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.4.0-SNAPSHOT")
33+
}
34+
35+
/*
36+
* Undo extendsFrom relationship between the 'antlr' configuration and the 'api' configuration,
37+
* causing Shadow to shade it. See:
38+
* https://github.com/gradle/gradle/blob/fe863b559778fb57e926f55c2162bd17f153c637/platforms/jvm/antlr/src/main/java/org/gradle/api/plugins/antlr/AntlrPlugin.java#L70
39+
*
40+
* Workaround by: https://github.com/gradle/gradle/issues/820#issuecomment-3491381422
41+
*/
42+
configurations {
43+
api {
44+
extendsFrom = extendsFrom.findAll { it != configurations.antlr }
45+
}
3346
}
3447

3548
base {
3649
archivesName = "MagicSpells"
3750
}
3851

3952
shadowJar {
40-
configurations = [project.configurations.shadow]
41-
4253
relocate("com.github.benmanes.caffeine", "com.nisovin.magicspells.shaded.com.github.benmanes.caffeine")
4354
relocate("org.apache.commons.math4", "com.nisovin.magicspells.shaded.org.apache.commons.math4")
4455
relocate("de.slikey.effectlib", "com.nisovin.magicspells.shaded.effectlib")
@@ -64,7 +75,11 @@ shadowJar {
6475
}
6576

6677
jar {
67-
enabled = false
78+
destinationDirectory = layout.buildDirectory.dir("publication")
79+
}
80+
81+
shadow {
82+
addShadowVariantIntoJavaComponent = false
6883
}
6984

7085
generateGrammarSource {
@@ -75,7 +90,7 @@ generateGrammarSource {
7590
publishing {
7691
publications {
7792
maven(MavenPublication) {
78-
from components.shadow
93+
from components.java
7994
}
8095
}
8196
}

‎factions/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
implementation project(":core")
2+
compileOnly project(":core")
33
//implementation ":MassiveCore"
44
//implementation ":Factions"
55
}

‎memory/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
implementation project(":core")
2+
compileOnly project(":core")
33
}
44

55
jar {

‎nms/latest/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ plugins {
44

55
dependencies {
66
paperweight.paperDevBundle("26.2.build.+")
7-
implementation project(":nms:shared")
7+
compileOnly project(":nms:shared")
88
}

‎nms/shared/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
implementation("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT") { transitive = false }
2+
compileOnly("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT")
33
}

‎nms/v26_1_2/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ plugins {
44

55
dependencies {
66
paperweight.paperDevBundle("26.1.2.build.+")
7-
implementation project(":nms:shared")
7+
compileOnly project(":nms:shared")
88
}

‎shop/build.gradle‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dependencies {
2-
implementation project(":core")
3-
implementation("org.incendo:cloud-paper:2.0.0-beta.16")
4-
implementation("net.milkbowl.vault:VaultAPI:1.7") { transitive = false }
2+
compileOnly project(":core")
3+
compileOnly("org.incendo:cloud-paper:2.0.0-beta.16")
4+
compileOnly("net.milkbowl.vault:VaultAPI:1.7")
55
}
66

77
jar {

0 commit comments

Comments
 (0)