diff --git a/build.gradle b/build.gradle index 6afba09..8f7159b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,43 +1,43 @@ apply plugin: 'base' description = "Spring Cloud" - + buildscript { - repositories { - maven { url 'http://repo.springsource.org/plugins-release' } - } - dependencies { - classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5' - classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE' - } + repositories { + maven { url 'http://repo.springsource.org/plugins-release' } + } + dependencies { + classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5' + classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE' + } } ext { - springVersion = "3.1.4.RELEASE" - tomcatVersion = "7.0.53" + springVersion = "3.1.4.RELEASE" + tomcatVersion = "7.0.53" - springAmqpVersion = "1.1.1.RELEASE" - springDataRedisVersion = "1.1.1.RELEASE" - springDataMongoVersion = "1.2.4.RELEASE" - - jedisVersion = "2.1.0" + springAmqpVersion = "1.1.1.RELEASE" + springDataRedisVersion = "1.1.1.RELEASE" + springDataMongoVersion = "1.2.4.RELEASE" - commonDbcpVersion = "1.4" - commonDbcp2Version = "2.0" + jedisVersion = "2.1.0" - mysqlDriverVersion = "5.1.29" - mariadbDriverVersion = "1.1.3" - postgresDriverVersion = "9.0-801.jdbc4" - javaxMailVersion = "1.4.7" - cglibVersion = "3.1" + commonDbcpVersion = "1.4" + commonDbcp2Version = "2.0" - jacksonVersion = "2.3.3" + mysqlDriverVersion = "5.1.29" + mariadbDriverVersion = "1.1.3" + postgresDriverVersion = "9.0-801.jdbc4" + javaxMailVersion = "1.4.7" + cglibVersion = "3.1" - log4jVersion = "1.2.17" + jacksonVersion = "2.3.3" + + log4jVersion = "1.2.17" + + junitVersion = "4.11" + mockitoVersion = "1.9.5" - junitVersion = "4.11" - mockitoVersion = "1.9.5" - javadocLinks = [ 'http://docs.oracle.com/javase/7/docs/api/', 'http://docs.oracle.com/javaee/6/api/', @@ -45,70 +45,70 @@ ext { 'http://docs.spring.io/spring-amqp/docs/latest-ga/api/', 'http://docs.spring.io/spring-data/data-mongo/docs/current/api/', 'http://docs.spring.io/spring-data/data-redis/docs/current/api/' - ] as String[] + ] as String[] } subprojects { - apply plugin: 'java' - apply plugin: 'maven' - apply plugin: 'eclipse' - - apply plugin: 'propdeps' - apply plugin: 'propdeps-maven' - apply plugin: 'propdeps-idea' - apply plugin: 'propdeps-eclipse' + apply plugin: 'java' + apply plugin: 'maven' + apply plugin: 'eclipse' - apply from: "${rootProject.projectDir}/publish-maven.gradle" + apply plugin: 'propdeps' + apply plugin: 'propdeps-maven' + apply plugin: 'propdeps-idea' + apply plugin: 'propdeps-eclipse' - if (project.hasProperty('platformVersion')) { - apply plugin: 'spring-io' + apply from: "${rootProject.projectDir}/publish-maven.gradle" - // necessary to resolve the Spring IO versions (which may include snapshots) - repositories { - maven { url "https://repo.spring.io/libs-snapshot" } - } + if (project.hasProperty('platformVersion')) { + apply plugin: 'spring-io' - dependencies { - springIoVersions "io.spring.platform:platform-versions:${platformVersion}@properties" - } - } + // necessary to resolve the Spring IO versions (which may include snapshots) + repositories { + maven { url "https://repo.spring.io/libs-snapshot" } + } - sourceCompatibility = 1.6 - targetCompatibility = 1.6 + dependencies { + springIoVersions "io.spring.platform:platform-versions:${platformVersion}@properties" + } + } + + sourceCompatibility = 1.6 + targetCompatibility = 1.6 javadoc { - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = project.name - } - - task packageSources(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource - } - + options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.author = true + options.header = project.name + } + + task packageSources(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource + } + task javadocJar(type: Jar) { - classifier = "javadoc" - from javadoc - } + classifier = "javadoc" + from javadoc + } - artifacts { - archives packageSources - archives javadocJar - } + artifacts { + archives packageSources + archives javadocJar + } + + dependencies { + testCompile("junit:junit:$junitVersion") + testCompile("org.mockito:mockito-core:$mockitoVersion") + } - dependencies { - testCompile("junit:junit:$junitVersion") - testCompile("org.mockito:mockito-core:$mockitoVersion") - } - repositories { - mavenLocal() + mavenLocal() - maven { url "http://repo.spring.io/snapshot" } - maven { url "http://repo.spring.io/milestone" } - maven { url "http://repo.spring.io/libs-milestone" } - maven { url "http://repo.maven.apache.org/maven2" } + maven { url "http://repo.spring.io/snapshot" } + maven { url "http://repo.spring.io/milestone" } + maven { url "http://repo.spring.io/libs-milestone" } + maven { url "http://repo.maven.apache.org/maven2" } } } @@ -117,80 +117,80 @@ configure(rootProject) { group = 'Distribution' classifier = 'schema' description = "Builds -${classifier} archive containing all " + - "XSDs for deployment at static.springframework.org/schema." - + "XSDs for deployment at static.springframework.org/schema." + subprojects.each { subproject -> def Properties schemas = new Properties(); def shortName = subproject.name - + subproject.sourceSets.main.resources.find { it.path.endsWith('META-INF/spring.schemas') }?.withInputStream { schemas.load(it) } - + for (def key : schemas.keySet()) { File xsdFile = subproject.sourceSets.main.resources.find { it.path.endsWith(schemas.get(key)) } assert xsdFile != null - into ("cloud") { + into("cloud") { from xsdFile.path } } } } - + task api(type: Javadoc) { - group = "Documentation" - description = "Generates aggregated Javadoc API documentation." - title = "${rootProject.description} ${version} API" - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = rootProject.description - options.links(project.ext.javadocLinks) + group = "Documentation" + description = "Generates aggregated Javadoc API documentation." + title = "${rootProject.description} ${version} API" + options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.author = true + options.header = rootProject.description + options.links(project.ext.javadocLinks) - source subprojects.collect { project -> - project.sourceSets.main.allJava - } + source subprojects.collect { project -> + project.sourceSets.main.allJava + } - classpath = files(subprojects.collect { project -> - project.sourceSets.main.compileClasspath - }) + classpath = files(subprojects.collect { project -> + project.sourceSets.main.compileClasspath + }) + + maxMemory = "1024m" + destinationDir = new File(buildDir, "api") + } - maxMemory = "1024m" - destinationDir = new File(buildDir, "api") - } - task docsZip(type: Zip) { group = 'Distribution' classifier = 'docs' description = "Builds -${classifier} archive containing api and reference " + - "for deployment at docs.spring.io/spring-cloud/docs." + "for deployment at docs.spring.io/spring-cloud/docs." - from (api) { + from(api) { into 'api' } } - + artifacts { - archives docsZip + archives docsZip archives schemaZip } } ext { matrix = [ - "mongo13" : [springDataMongoVersion : "1.3.5.RELEASE"], - "mongo14" : [springDataMongoVersion : "1.4.2.RELEASE"], - "mongo15" : [springDataMongoVersion : "1.5.0.RELEASE"], - "jedis22-redis11" : [jedisVersion : "2.2.1", springDataRedisVersion : "1.1.1.RELEASE"], - "jedis23-redis12" : [jedisVersion : "2.3.1", springDataRedisVersion : "1.2.1.RELEASE"], - "jedis23-redis13" : [jedisVersion : "2.3.1", springDataRedisVersion : "1.3.0.RELEASE"], - "jedis24-redis13" : [jedisVersion : "2.4.2", springDataRedisVersion : "1.3.0.RELEASE"], - "amqp11" : [springAmqpVersion: "1.1.4.RELEASE"], - "amqp12" : [springAmqpVersion: "1.2.2.RELEASE"], - "amqp13" : [springAmqpVersion: "1.3.6.RELEASE"], - "spring32": [springVersion : "3.2.9.RELEASE"], - "spring40": [springVersion : "4.0.5.RELEASE"] + "mongo13" : [springDataMongoVersion: "1.3.5.RELEASE"], + "mongo14" : [springDataMongoVersion: "1.4.2.RELEASE"], + "mongo15" : [springDataMongoVersion: "1.5.0.RELEASE"], + "jedis22-redis11": [jedisVersion: "2.2.1", springDataRedisVersion: "1.1.1.RELEASE"], + "jedis23-redis12": [jedisVersion: "2.3.1", springDataRedisVersion: "1.2.1.RELEASE"], + "jedis23-redis13": [jedisVersion: "2.3.1", springDataRedisVersion: "1.3.0.RELEASE"], + "jedis24-redis13": [jedisVersion: "2.4.2", springDataRedisVersion: "1.3.0.RELEASE"], + "amqp11" : [springAmqpVersion: "1.1.4.RELEASE"], + "amqp12" : [springAmqpVersion: "1.2.2.RELEASE"], + "amqp13" : [springAmqpVersion: "1.3.6.RELEASE"], + "spring32" : [springVersion: "3.2.9.RELEASE"], + "spring40" : [springVersion: "4.0.5.RELEASE"] ] } @@ -198,15 +198,15 @@ task matrixTests task defineMatrixTests { def createTestTask = { name, props -> - task "$name"(type: GradleBuild) { - tasks = ['test'] - startParameter.projectProperties = props - } + task "$name"(type: GradleBuild) { + tasks = ['test'] + startParameter.projectProperties = props + } } matrix.each { sp -> def testTask = createTestTask(sp.key, sp.value) matrixTests.dependsOn(testTask.name) - } + } } @@ -216,5 +216,5 @@ task dist(dependsOn: assemble) { } task wrapper(type: Wrapper) { - gradleVersion = '1.12' + gradleVersion = '1.12' }