Skip to content

Commit

Permalink
fixed multiproject build so that the resulting jar does not contain a…
Browse files Browse the repository at this point in the history
…ll the dependencies
  • Loading branch information
renep committed Nov 8, 2016
1 parent f19a0ca commit 953041b
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 96 deletions.
69 changes: 69 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
allprojects {
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'

def versionNumber = "0.14.0"

if (project.hasProperty("versionNumber")) {
versionNumber = project.versionNumber
}
if (project.hasProperty("versionSuffix")) {
versionNumber += project.versionSuffix
}
if (project.hasProperty("buildNumber")) {
versionNumber += "." + project.buildNumber
}


group = 'org.openbakery'
version = versionNumber

sourceCompatibility = "1.6"
targetCompatibility = "1.6"

repositories {
mavenCentral()
}

dependencies {
compile localGroovy()
compile 'commons-io:commons-io:2.2'
compile 'commons-configuration:commons-configuration:1.10'
compile 'commons-collections:commons-collections:3.2.2'
compile 'commons-codec:commons-codec:1.10'
compile 'ch.qos.logback:logback-core:1.0.13'

testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.codehaus.groovy:groovy-all:2.4.4'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'org.objenesis:objenesis:1.2'
testCompile 'cglib:cglib-nodep:2.2.2'
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
}

}
}



project(':plugin') {
dependencies {
compile project(':libxcode')
testCompile project(':libtest')
}
}


project(':libxcode') {
dependencies {
testCompile project(':libtest')
}
}

project(':libtest') {
dependencies {
compile project(':libxcode')
}
}
18 changes: 0 additions & 18 deletions libtest/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'

configurations {
includeInJar
}

repositories {
mavenCentral()
}

dependencies {
compile localGroovy()
includeInJar project(':libxcode')
compile 'commons-io:commons-io:2.2'
compile 'commons-configuration:commons-configuration:1.10'
compile 'commons-collections:commons-collections:3.2.2'
configurations.compile.extendsFrom(configurations.includeInJar)

}
35 changes: 0 additions & 35 deletions libxcode/build.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +0,0 @@
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'

configurations {
includeInTest
}


repositories {
mavenCentral()
}

dependencies {
compile localGroovy()
includeInTest project(':libtest')

compile 'commons-io:commons-io:2.2'
compile 'commons-configuration:commons-configuration:1.10'
compile 'commons-collections:commons-collections:3.2.2'
compile 'commons-codec:commons-codec:1.10'
compile 'ch.qos.logback:logback-core:1.0.13'
compile 'org.slf4j:slf4j-api:1.7.21'

testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.codehaus.groovy:groovy-all:2.4.4'
testCompile 'org.objenesis:objenesis:1.2'
testCompile 'cglib:cglib-nodep:2.2.2'
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
}
configurations.testCompile.extendsFrom(configurations.includeInTest)

}

50 changes: 7 additions & 43 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ plugins {
}


def versionNumber = '0.14.0'
def publishURL = System.getenv("PUBLISH_URL")
def publishUser = System.getenv("PUBLISH_USER")
def publishPassword = System.getenv("PUBLISH_PASSWORD")
Expand All @@ -19,75 +18,41 @@ if (project.hasProperty("publishUser")) {
if (project.hasProperty("publishPassword")) {
publishPassword = project.publishPassword
}
if (project.hasProperty("versionNumber")) {
versionNumber = project.versionNumber
}
if (project.hasProperty("versionSuffix")) {
versionNumber += project.versionSuffix
}
if (project.hasProperty("buildNumber")) {
versionNumber += "." + project.buildNumber
}


group = 'org.openbakery'
version = versionNumber

cobertura.coverageFormats = ['html', 'xml']

apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'
apply plugin: 'maven'


sourceCompatibility = "1.6"
targetCompatibility = "1.6"
repositories {
mavenCentral()
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14'
}

configurations {
deployerJars
includeInJar
includeInTest
}

repositories {
mavenCentral()
}


dependencies {
compile gradleApi()
compile localGroovy()
includeInJar project(':libxcode')
includeInTest project(':libtest')
compile 'commons-io:commons-io:2.2'
compile 'commons-configuration:commons-configuration:1.10'
compile 'commons-collections:commons-collections:3.2.2'
compile 'org.apache.httpcomponents:httpclient:4.4.1'
compile 'org.apache.httpcomponents:httpmime:4.4.1'
compile 'org.pegdown:pegdown:1.5.+'
compile 'ch.qos.logback:logback-core:1.0.13'
compile 'org.openbakery.coverage:CoverageReport:0.9.3'
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.codehaus.groovy:groovy-all:2.4.4'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'org.objenesis:objenesis:1.2'
testCompile 'cglib:cglib-nodep:2.2.2'
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.10'
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
}

configurations.compile.extendsFrom(configurations.includeInJar)
configurations.testCompile.extendsFrom(configurations.includeInTest)
}

jar {
baseName 'xcode-plugin'
from configurations.includeInJar.collect { it.isDirectory() ? it : zipTree(it) }
from project.sourceSets.main.allSource
from project(":libxcode").sourceSets.main.allSource
//from configurations.includeInJar.collect { it.isDirectory() ? it : zipTree(it) }
}

uploadArchives {
Expand Down Expand Up @@ -136,7 +101,6 @@ pluginBundle {
xcodePlugin {
id = 'org.openbakery.xcode-plugin'
displayName = 'Gradle Xcode plugin'
version = versionNumber
}
}
}

0 comments on commit 953041b

Please sign in to comment.