Skip to content

Commit

Permalink
improved #15 by removing further unrequired dependencies and
Browse files Browse the repository at this point in the history
refactorings of this file
  • Loading branch information
Andreas Schmid committed Mar 7, 2014
1 parent ba5deda commit ba8d512
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
compile group: 'junit', name: 'junit-dep', version: '4.8.2' /* provided scope */
compile group: 'junit', name: 'junit-dep', version: '4.8.2'
compile group: 'com.google.code.findbugs', name: 'annotations', version: '2.0.1'

testCompile group: 'org.assertj', name: 'assertj-core', version: '1.2.0'
Expand All @@ -27,12 +27,11 @@ task jenkinsTest {
// required due to jenkins fails if test output is not up to date :(
// Solution found on http://www.practicalgradle.org/blog/2011/06/incremental-tests-with-jenkins/
inputs.files test.outputs.files
doLast{
doLast {
def timestamp = System.currentTimeMillis()
test.testResultsDir.eachFile { it.lastModified = timestamp }
test.getReports().getJunitXml().getDestination().eachFile{ it.lastModified = timestamp }
}
}

build.dependsOn(jenkinsTest)

jar {
Expand Down Expand Up @@ -83,7 +82,9 @@ apply plugin: 'signing'

signing {
// requires gradle.properties, see http://www.gradle.org/docs/current/userguide/signing_plugin.html
required { gradle.taskGraph.hasTask("uploadArchives") }
required {
gradle.taskGraph.hasTask("uploadArchives")
}
sign configurations.archives
}

Expand All @@ -97,7 +98,9 @@ if (!hasProperty('sonatypePassword')) {
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
// username and password from gradle.properties
Expand Down Expand Up @@ -140,7 +143,11 @@ uploadArchives {
}
}
whenConfigured { pom ->
pom.dependencies.find{ dep -> dep.groupId == 'junit' && dep.artifactId == 'junit-dep' }.scope = 'provided'
pom.dependencies.find{ dep -> dep.groupId == 'junit' && dep.artifactId == 'junit-dep' }.with {
version = '[4.8.2,4.11]'
scope = 'provided'
}
pom.dependencies.removeAll(pom.dependencies.findAll{ dep -> dep.scope in [ 'compile', 'test' ] })
}
}
}
Expand Down

0 comments on commit ba8d512

Please sign in to comment.