Fixed gradle shadow issues

Now relocation works, the relocated items were not being depended on
This commit is contained in:
Rsl1122 2018-12-19 19:08:07 +02:00
parent 8e2df1de9b
commit 51eb37c382
7 changed files with 38 additions and 13 deletions

View File

@ -92,10 +92,11 @@ subprojects {
testCompile "org.xerial:sqlite-jdbc:3.25.2" // SQLite
}
// Test classes available to other modules
configurations {
testArtifacts.extendsFrom testRuntime
}
// Test classes available to other modules
task testJar(type: Jar) {
classifier "test"
from sourceSets.test.output

View File

@ -1,5 +1,6 @@
dependencies {
compile project(":common")
compile project(path: ":common", configuration: 'shadow')
compile "com.djrapitops:AbstractPluginFramework-bukkit:$abstractPluginFrameworkVersion"
compile "org.bstats:bstats-bukkit:$bstatsVersion"
@ -15,6 +16,8 @@ dependencies {
}
shadowJar {
configurations = [project.configurations.compile]
relocate 'org.bstats', 'com.djrapitops.plan.utilities.metrics'
relocate 'org.slf4j', 'plan.org.slf4j'
}

View File

@ -1,5 +1,5 @@
dependencies {
compile project(":common")
compile project(path: ":common", configuration: 'shadow')
compile "com.djrapitops:AbstractPluginFramework-bungeecord:$abstractPluginFrameworkVersion"
compile "org.bstats:bstats-bungeecord:$bstatsVersion"
@ -13,6 +13,8 @@ dependencies {
}
shadowJar {
configurations = [project.configurations.compile]
relocate 'org.bstats', 'com.djrapitops.plan.utilities.metrics'
relocate 'org.slf4j', 'plan.org.slf4j'
}

View File

@ -20,14 +20,25 @@ dependencies {
}
shadowJar {
relocate ('org.apache', 'plan.org.apache') {
configurations = [project.configurations.compile]
// Exclude these files
exclude "org/json/**/*"
exclude "**/*.svg"
exclude "**/*.ttf"
exclude "**/*.woff"
exclude "**/*.eot"
exclude "**/*.woff2"
exclude "**/*.psd"
relocate('org.apache', 'plan.org.apache') {
exclude 'org/apache/logging/**'
}
relocate 'com.maxmind', 'plan.com.maxmind'
relocate 'com.fasterxml', 'plan.com.fasterxml'
relocate 'com.zaxxer', 'plan.com.zaxxer'
relocate 'org.h2', 'plan.org.h2'
relocate 'org.bstats', 'plan.org.bstats'
relocate 'org.slf4j', 'plan.org.slf4j'
relocate 'com.google.dagger', 'plan.com.google.dagger'
}

View File

@ -1,10 +1,9 @@
dependencies {
compile project(":common")
compile project(":bukkit")
compile project(":sponge")
compile project(":bungeecord")
compile project(":velocity")
compile project(path: ":common", configuration: 'shadow')
compile project(path: ":bukkit", configuration: 'shadow')
compile project(path: ":sponge", configuration: 'shadow')
compile project(path: ":bungeecord", configuration: 'shadow')
compile project(path: ":velocity", configuration: 'shadow')
testCompile project(path: ":common", configuration: 'testArtifacts')
testCompile project(path: ":bukkit", configuration: 'testArtifacts')
testCompile project(path: ":sponge", configuration: 'testArtifacts')
@ -13,6 +12,8 @@ dependencies {
}
shadowJar {
configurations = [project.configurations.compile]
destinationDir = file("$rootDir/builds/")
classifier = null
}

View File

@ -1,5 +1,6 @@
dependencies {
compile project(":common")
compile project(path: ":common", configuration: 'shadow')
compile "com.djrapitops:AbstractPluginFramework-sponge:$abstractPluginFrameworkVersion"
compile "org.bstats:bstats-sponge:$bstatsVersion"
@ -12,5 +13,7 @@ dependencies {
}
shadowJar {
configurations = [project.configurations.compile]
relocate "org.bstats", "com.djrapitops.plan.utilities.metrics"
}

View File

@ -1,5 +1,5 @@
dependencies {
compile project(":common")
compile project(path: ":common", configuration: 'shadow')
compile "com.djrapitops:AbstractPluginFramework-velocity:$abstractPluginFrameworkVersion"
compileOnly "com.velocitypowered:velocity-api:$velocityVersion"
@ -8,4 +8,8 @@ dependencies {
annotationProcessor "com.velocitypowered:velocity-api:$velocityVersion"
testCompile project(path: ":common", configuration: 'testArtifacts')
}
shadowJar {
configurations = [project.configurations.compile]
}