Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build now uses shadow to relocate dependencies. #217

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
id 'java-gradle-plugin'
id 'maven'
id 'jacoco'
id 'com.github.johnrengelman.plugin-shadow' version '2.0.2'
id 'pl.allegro.tech.build.axion-release' version '1.8.1'
id 'com.github.kt3k.coveralls' version '2.3.1'
id 'com.gradle.plugin-publish' version '0.9.8'
id 'com.bmuschko.nexus' version '2.3.1' apply false
id 'io.codearte.nexus-staging' version '0.5.3' apply false

id 'me.champeau.gradle.jmh' version '0.4.3'
id 'com.bmuschko.docker-remote-api' version '3.2.1'
}
Expand All @@ -30,6 +30,9 @@ scmVersion {
versionCreator 'versionWithBranch'
}

// Remove the gradleApi so it isn't merged into the jar file.
configurations.compile.dependencies.remove dependencies.gradleApi()

group = 'pl.allegro.tech.build'
version = scmVersion.version

Expand Down Expand Up @@ -74,8 +77,8 @@ sourceSets {
}

dependencies {
compile gradleApi()
compile localGroovy()
shadow gradleApi()
shadow localGroovy()

compile (group: 'org.ajoberstar', name: 'grgit', version: '1.7.2') {
exclude group: 'org.eclipse.jgit', module: 'org.eclipse.jgit.ui'
Expand All @@ -98,6 +101,22 @@ dependencies {
testCompile gradleTestKit()
}

shadowJar {
relocate 'org.ajoberstar','axion.org.ojoberstar'
relocate 'org.eclipse.jgit','axion.org.eclipse.jgit'
relocate 'com.jcraft','axion.com.jcraft'
relocate 'com.github.zafarkhaja','axion.com.github.zafarkhaja'
relocate 'com.googlecode','axion.com.googlecode'
relocate 'org.apache.commons','axion.org.apache.commons'
relocate 'org.apache.http','axion.org.apache.http'
relocate 'org.slf4j','axion.org.slf4j'
relocate 'com.sun.jna','axion.com.sun.jna'

classifier = ''
}

tasks.build.dependsOn tasks.shadowJar

test {
testLogging {
events 'passed', 'skipped', 'failed'
Expand Down