Files
spring-cloud-connectors/build.gradle

215 lines
5.1 KiB
Groovy

apply plugin: 'base'
description = "Spring Cloud Connectors"
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
classpath 'io.spring.gradle:spring-io-plugin:0.0.8.RELEASE'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.12'
classpath 'io.spring.nohttp:nohttp-gradle:0.0.1.RELEASE'
}
}
ext {
junitVersion = "4.12"
mockitoVersion = "2.7.22"
javadocLinks = [
'https://docs.oracle.com/javase/8/docs/api/',
'https://docs.spring.io/spring/docs/current/javadoc-api/',
'https://docs.spring.io/spring-amqp/docs/latest-ga/api/',
'https://docs.spring.io/spring-data/data-mongo/docs/current/api/',
'https://docs.spring.io/spring-data/data-redis/docs/current/api/'
] as String[]
}
apply plugin: 'io.spring.nohttp'
checkstyle {
toolVersion = 8.16
}
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: "org.asciidoctor.gradle.asciidoctor"
asciidoctor {
sourceDir = new File("docs/src/main/asciidoc")
outputDir = new File("docs/target/generated-docs")
options = [
'doctype': 'book'
]
attributes = [
'source-highlighter': 'coderay'
]
}
apply from: "${rootProject.projectDir}/publish-maven.gradle"
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
// necessary to resolve the Spring IO versions (which may include snapshots)
repositories {
maven { url "https://repo.spring.io/libs-snapshot" }
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${platformVersion}"
}
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
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
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives packageSources
archives javadocJar
}
dependencies {
testCompile("junit:junit:$junitVersion")
testCompile("org.mockito:mockito-core:$mockitoVersion")
}
repositories {
mavenCentral()
}
}
configure(rootProject) {
task schemaZip(type: Zip) {
group = 'Distribution'
classifier = 'schema'
description = "Builds -${classifier} archive containing all " +
"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") {
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)
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
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."
from(api) {
into 'api'
}
}
artifacts {
archives docsZip
archives schemaZip
}
repositories {
mavenCentral()
}
}
ext {
matrix = [
"driver34-mongo20" : [mongoDriverVersion: "3.4.2", springDataMongoVersion: "2.0.0.RELEASE"],
"jedis29-redis20" : [jedisVersion: "2.9.0", springDataRedisVersion: "2.0.0.RELEASE"],
"lettuce5-redis20" : [lettuceVersion: "5.0.0.RELEASE", springDataRedisVersion: "2.0.0.RELEASE"],
"driver330-cass20" : [cassandraDriverVersion: "3.3.0", springDataCassandraVersion: "2.0.0.RELEASE"],
"amqp200" : [springAmqpVersion: "2.0.0.RELEASE"],
"amqp205-rabbit541" : [springAmqpVersion: "2.0.5.RELEASE", "rabbitClientVersion": "5.4.1"],
"spring50" : [springVersion: "5.0.0.RELEASE"],
"tomcat85" : [tomcatVersion: "8.5.13"],
]
}
task matrixTests
task defineMatrixTests {
def createTestTask = { name, props ->
task "$name"(type: GradleBuild) {
tasks = ['test']
startParameter.projectProperties = props
}
}
matrix.each { sp ->
def testTask = createTestTask(sp.key, sp.value)
matrixTests.dependsOn(testTask.name)
}
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}