diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 340587455..23cb2ab6e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,4 +63,4 @@ jobs: with: name: MagicSpells-${{steps.version.outputs.version}}-${{steps.hash.outputs.sha_short}} if-no-files-found: error - path: core/build/libs/MagicSpells*.jar + path: core/build/libs/MagicSpells-${{steps.version.outputs.version}}-${{steps.hash.outputs.sha_short}}.jar diff --git a/README.md b/README.md index 139c5761b..a6c59886c 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ repositories { } dependencies { - implementation("com.github.TheComputerGeek2.MagicSpells:core:main-SNAPSHOT") {transitive = false} + compileOnly("com.github.TheComputerGeek2.MagicSpells:core:main-SNAPSHOT") } ``` diff --git a/build.gradle b/build.gradle index 341b3ed6b..b0b745008 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ subprojects { apply plugin: "dev.magicspells.msjava" dependencies { - implementation("io.papermc.paper:paper-api:26.1.2.build.+") + compileOnly("io.papermc.paper:paper-api:26.1.2.build.+") } processResources { diff --git a/core/build.gradle b/core/build.gradle index 4b1bf1ce7..9ba478520 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -4,32 +4,45 @@ plugins { } dependencies { - shadow("org.apache.commons:commons-math4-core:4.0-beta1") - shadow("com.github.ben-manes.caffeine:caffeine:3.2.2") - shadow("com.github.Chronoken:EffectLib:1da888c") - shadow("org.incendo:cloud-paper:2.0.0-beta.16") - shadow("org.incendo:cloud-minecraft-extras:2.0.0-beta.16") - shadow("org.incendo:cloud-processors-requirements:1.0.0-rc.1") - shadow("org.bstats:bstats-bukkit:3.2.1") - shadow("com.github.ezylang:EvalEx:3.6.2") + implementation("org.apache.commons:commons-math4-core:4.0-beta1") + implementation("com.github.ben-manes.caffeine:caffeine:3.2.2") + implementation("com.github.Chronoken:EffectLib:1da888c") + implementation("org.incendo:cloud-paper:2.0.0-beta.16") + implementation("org.incendo:cloud-minecraft-extras:2.0.0-beta.16") + implementation("org.incendo:cloud-processors-requirements:1.0.0-rc.1") + implementation("org.bstats:bstats-bukkit:3.2.1") + implementation("com.github.ezylang:EvalEx:3.6.2") - shadow("org.antlr:antlr4-runtime:4.13.2") + implementation("org.antlr:antlr4-runtime:4.13.2") antlr("org.antlr:antlr4:4.13.2") - shadow(project(path: ":nms:shared", configuration: "apiElements")) - shadow(project(path: ":nms:latest")) { transitive = false } - shadow(project(path: ":nms:v26_1_2")) { transitive = false } + implementation(project(path: ":nms:shared")) + implementation(project(path: ":nms:latest")) + implementation(project(path: ":nms:v26_1_2")) - implementation("com.github.retrooper:packetevents-spigot:2.11.2") - implementation("net.dmulloy2:ProtocolLib:5.4.0") { transitive = false } - implementation("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT") { transitive = false } - implementation("net.milkbowl.vault:VaultAPI:1.7") { transitive = false } - implementation("me.clip:placeholderapi:2.12.2") { transitive = false } - implementation("com.github.GriefPrevention:GriefPrevention:18.0.0") { transitive = false } - implementation("com.sk89q.worldguard:worldguard-core:7.1.0-SNAPSHOT") { transitive = false } - implementation("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT") { transitive = false } - implementation("com.sk89q.worldedit:worldedit-core:7.4.0-SNAPSHOT") { transitive = false } - implementation("com.sk89q.worldedit:worldedit-bukkit:7.4.0-SNAPSHOT") { transitive = false } + compileOnly("com.github.retrooper:packetevents-spigot:2.11.2") + compileOnly("net.dmulloy2:ProtocolLib:5.4.0") + compileOnly("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT") + compileOnly("net.milkbowl.vault:VaultAPI:1.7") + compileOnly("me.clip:placeholderapi:2.12.2") + compileOnly("com.github.GriefPrevention:GriefPrevention:18.0.0") + compileOnly("com.sk89q.worldguard:worldguard-core:7.1.0-SNAPSHOT") + compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT") + compileOnly("com.sk89q.worldedit:worldedit-core:7.4.0-SNAPSHOT") + compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.4.0-SNAPSHOT") +} + +/* + * Undo extendsFrom relationship between the 'antlr' configuration and the 'api' configuration, + * causing Shadow to shade it. See: + * https://github.com/gradle/gradle/blob/fe863b559778fb57e926f55c2162bd17f153c637/platforms/jvm/antlr/src/main/java/org/gradle/api/plugins/antlr/AntlrPlugin.java#L70 + * + * Workaround by: https://github.com/gradle/gradle/issues/820#issuecomment-3491381422 + */ +configurations { + api { + extendsFrom = extendsFrom.findAll { it != configurations.antlr } + } } base { @@ -37,8 +50,6 @@ base { } shadowJar { - configurations = [project.configurations.shadow] - relocate("com.github.benmanes.caffeine", "com.nisovin.magicspells.shaded.com.github.benmanes.caffeine") relocate("org.apache.commons.math4", "com.nisovin.magicspells.shaded.org.apache.commons.math4") relocate("de.slikey.effectlib", "com.nisovin.magicspells.shaded.effectlib") @@ -64,7 +75,11 @@ shadowJar { } jar { - enabled = false + destinationDirectory = layout.buildDirectory.dir("publication") +} + +shadow { + addShadowVariantIntoJavaComponent = false } generateGrammarSource { @@ -75,7 +90,7 @@ generateGrammarSource { publishing { publications { maven(MavenPublication) { - from components.shadow + from components.java } } } diff --git a/factions/build.gradle b/factions/build.gradle index bc2c49442..80c11280d 100644 --- a/factions/build.gradle +++ b/factions/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation project(":core") + compileOnly project(":core") //implementation ":MassiveCore" //implementation ":Factions" } diff --git a/memory/build.gradle b/memory/build.gradle index bfb8bd5ce..3e3722fee 100644 --- a/memory/build.gradle +++ b/memory/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation project(":core") + compileOnly project(":core") } jar { diff --git a/nms/latest/build.gradle b/nms/latest/build.gradle index 47d830cfc..229ded7f4 100644 --- a/nms/latest/build.gradle +++ b/nms/latest/build.gradle @@ -4,5 +4,5 @@ plugins { dependencies { paperweight.paperDevBundle("26.2.build.+") - implementation project(":nms:shared") + compileOnly project(":nms:shared") } diff --git a/nms/shared/build.gradle b/nms/shared/build.gradle index cf2607414..2cace6375 100644 --- a/nms/shared/build.gradle +++ b/nms/shared/build.gradle @@ -1,3 +1,3 @@ dependencies { - implementation("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT") { transitive = false } + compileOnly("me.libraryaddict.disguises:libsdisguises:11.0.16-SNAPSHOT") } diff --git a/nms/v26_1_2/build.gradle b/nms/v26_1_2/build.gradle index 78c915976..0f8288b90 100644 --- a/nms/v26_1_2/build.gradle +++ b/nms/v26_1_2/build.gradle @@ -4,5 +4,5 @@ plugins { dependencies { paperweight.paperDevBundle("26.1.2.build.+") - implementation project(":nms:shared") + compileOnly project(":nms:shared") } diff --git a/shop/build.gradle b/shop/build.gradle index cffaddf8b..1f35827e0 100644 --- a/shop/build.gradle +++ b/shop/build.gradle @@ -1,7 +1,7 @@ dependencies { - implementation project(":core") - implementation("org.incendo:cloud-paper:2.0.0-beta.16") - implementation("net.milkbowl.vault:VaultAPI:1.7") { transitive = false } + compileOnly project(":core") + compileOnly("org.incendo:cloud-paper:2.0.0-beta.16") + compileOnly("net.milkbowl.vault:VaultAPI:1.7") } jar { diff --git a/teams/build.gradle b/teams/build.gradle index ca6daf3b2..e5dcde414 100644 --- a/teams/build.gradle +++ b/teams/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation project(":core") + compileOnly project(":core") } jar { diff --git a/towny/build.gradle b/towny/build.gradle index 1d7ccca46..dd2fdfc49 100644 --- a/towny/build.gradle +++ b/towny/build.gradle @@ -1,6 +1,6 @@ dependencies { - implementation project(":core") - implementation("com.palmergames.bukkit.towny:towny:0.100.1.0") { transitive = false } + compileOnly project(":core") + compileOnly("com.palmergames.bukkit.towny:towny:0.100.1.0") } jar {