Skip to content

Commit

Permalink
INT-3780: Update to Gradle 2.5
Browse files Browse the repository at this point in the history
JIRA: https://jira.spring.io/browse/INT-3780

- Move `s-i-test` to top of file to avoid deprecation warning

- Change `jacoco` to use the Gradle plugin

- Enable generation of `jacoco` coverage html report

- Hibernate tests need `javax.persistence` `2.1` eclipselink pulls in `2.0`;
works ok with gradle 2.3, but with 2.5 the 2.0 versions are loaded.

- replace `jpaApiVersion` build variable with the `jpa21ApiVersion`
  • Loading branch information
garyrussell authored and artembilan committed Jul 23, 2015
1 parent 75a7b63 commit b69c0c2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ services:
- rabbitmq
- redis-server
env:
- TERM=dumb SI_FATAL_WHEN_NO_BEANFACTORY=true GRADLE_OPTS='-XX:MaxPermSize=512M -Xmx1024M'
- TERM=dumb SI_FATAL_WHEN_NO_BEANFACTORY=true
#script:
# - ./gradlew build --parallel
65 changes: 37 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE'
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.0'
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.1'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0'
}
}
Expand All @@ -18,8 +18,8 @@ def docsDir = 'src/reference/asciidoc' // Will be default with newer asciidoctor

ext {
linkHomepage = 'https://projects.spring.io/spring-integration'
linkCi = 'https://build.springsource.org/browse/INT'
linkIssue = 'https://jira.springsource.org/browse/INT'
linkCi = 'https://build.spring.io/browse/INT'
linkIssue = 'https://jira.spring.io/browse/INT'
linkScmUrl = 'https://github.com/spring-projects/spring-integration'
linkScmConnection = 'scm:git:git://github.com/spring-projects/spring-integration.git'
linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-integration.git'
Expand Down Expand Up @@ -56,6 +56,7 @@ subprojects { subproject ->
apply from: "${rootProject.projectDir}/publish-maven.gradle"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'

if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
Expand Down Expand Up @@ -105,7 +106,7 @@ subprojects { subproject ->
javaxMailVersion = '1.5.2'
jedisVersion = '2.7.3'
jmsApiVersion = '1.1-rev-1'
jpaApiVersion = '2.0.0'
jpa21ApiVersion = '1.0.0.Final'
jrubyVersion = '1.7.19'
jschVersion = '0.1.52'
jsonpathVersion = '2.0.0'
Expand Down Expand Up @@ -157,10 +158,8 @@ subprojects { subproject ->
}
}

// See http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:configurations
// and http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.ConfigurationContainer.html
configurations {
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
jacoco {
toolVersion = "0.7.5.201505241946"
}

// dependencies that are common across all java projects
Expand All @@ -177,7 +176,6 @@ subprojects { subproject ->
if (!(subproject.name ==~ /.*-(core|test)/)) {
testCompile project(":spring-integration-test")
}
jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.7.2.201409121644", classifier: "runtime"

testRuntime "org.slf4j:slf4j-log4j12:$slf4jVersion"
}
Expand Down Expand Up @@ -207,9 +205,20 @@ subprojects { subproject ->
}
}

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/reports/jacoco/html"
}
}

test {
maxHeapSize = "1024m"
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.integration.*"
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
}

task testAll(type: Test)
Expand Down Expand Up @@ -241,6 +250,22 @@ subprojects { subproject ->
archives javadocJar
}

build.dependsOn jacocoTestReport
}

project('spring-integration-test') {
description = 'Spring Integration Test Support'
dependencies {
compile project(":spring-integration-core")
compile ("junit:junit:$junitVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile "org.hamcrest:hamcrest-all:$hamcrestVersion"
compile ("org.mockito:mockito-core:$mockitoVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile "org.springframework:spring-test:$springVersion"
}
}

project('spring-integration-amqp') {
Expand Down Expand Up @@ -419,7 +444,7 @@ project('spring-integration-jpa') {
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-orm:$springVersion"
compile "org.eclipse.persistence:javax.persistence:$jpaApiVersion"
compile ("org.hibernate.javax.persistence:hibernate-jpa-2.1-api:$jpa21ApiVersion", optional)

testCompile "com.h2database:h2:$h2Version"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
Expand Down Expand Up @@ -570,21 +595,6 @@ project('spring-integration-syslog') {
}
}

project('spring-integration-test') {
description = 'Spring Integration Test Support'
dependencies {
compile project(":spring-integration-core")
compile ("junit:junit:$junitVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile "org.hamcrest:hamcrest-all:$hamcrestVersion"
compile ("org.mockito:mockito-core:$mockitoVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile "org.springframework:spring-test:$springVersion"
}
}

project('spring-integration-twitter') {
description = 'Spring Integration Twitter Support'
dependencies {
Expand Down Expand Up @@ -703,7 +713,6 @@ project('spring-integration-zookeeper') {
exclude group: 'org.apache.zookeeper', module: 'zookeeper'
}

testCompile "org.springframework.integration:spring-integration-test"
testCompile "org.apache.curator:curator-test:$curatorVersion"
}
}
Expand Down Expand Up @@ -935,6 +944,6 @@ task dist(dependsOn: assemble) {

task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '2.3'
gradleVersion = '2.5'
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 16 15:40:27 EET 2015
#Thu Jul 23 15:28:51 EDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.3-all.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.5-all.zip

0 comments on commit b69c0c2

Please sign in to comment.