From 880bc35d55689c7b2e0bc5b56b4c02db9eb80c1d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 15 Jul 2014 09:40:18 +0100 Subject: [PATCH] Add the Spring IO plugin and align with the Platform where possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure the Spring IO plugin such that it's only applied when the build is run with -PplatformVersion=. This platformVersion property is used to determine the version of the Platform that will be used when running the springIoCheck task. The plugin can be used by running a build as follows: ./gradlew clean springIoCheck -PplatformVersion=1.0.1.RELEASE -PJDK7_HOME=… -PJDK8_HOME=… This will test the project on JDK7 and JDK 8 using the dependencies defined in Spring IO Platform 1.0.1.RELEASE. Running the plugin identified a dependency on CGLib (use of spring-core's repackaged CGLib is preferred), but the dependency appears to be unused. It has been removed. The versions of a number of other dependencies have been updated to use their latest versions and align them with Spring IO Platform. Most notable is probably a move from Guava 15.0 to 17.0. --- build.gradle | 16 ++++++++++++++-- gradle.properties | 12 ++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index e8897676..8b04977b 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ buildscript { } dependencies { classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5' + classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE' } } @@ -23,15 +24,26 @@ apply from: "$rootDir/maven.gradle" apply plugin: 'docbook-reference' apply plugin: 'application' +if (project.hasProperty('platformVersion')) { + apply plugin: 'spring-io' + + repositories { + maven { url "https://repo.spring.io/libs-snapshot" } + } + + dependencies { + springIoVersions "io.spring.platform:platform-versions:${platformVersion}@properties" + } +} + [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial", "-Xlint:unchecked", "-Xlint:rawtypes"] dependencies { compile "org.springframework:spring-core:$springVersion" compile "org.springframework:spring-context-support:$springVersion" compile "commons-io:commons-io:$commonsioVersion" - compile "com.google.guava:guava:15.0" + compile "com.google.guava:guava:$guavaVersion" compile "jline:jline:$jlineVersion" - compile "cglib:cglib:$cglibVersion" // Testing diff --git a/gradle.properties b/gradle.properties index 3f7f7818..f21d141f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ -slf4jVersion=1.7.2 +slf4jVersion=1.7.7 +guavaVersion=17.0 jlineVersion=2.11 junitVersion=4.11 -springVersion=4.0.3.RELEASE -commonsioVersion=2.3 +springVersion=4.0.6.RELEASE +commonsioVersion=2.4 hamcrestVersion=1.3 version=1.1.0.BUILD-SNAPSHOT -cglibVersion=2.2.2 -mockitoVersion=1.8.5 -hamcrestDateVersion=0.9.3 +mockitoVersion=1.9.5 +hamcrestDateVersion=0.9.3 \ No newline at end of file