Files
spring-batch/build.gradle
2014-11-20 09:45:15 -06:00

808 lines
28 KiB
Groovy

description = 'Spring Batch'
apply plugin: 'base'
apply plugin: 'idea'
buildscript {
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.8'
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5'
classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE'
}
}
ext {
linkHomepage = 'http://projects.spring.io/spring-batch/'
linkCi = 'https://build.spring.io/browse/BATCH'
linkIssue = 'https://jira.spring.io/browse/BATCH'
linkScmUrl = 'https://github.com/spring-projects/spring-batch'
linkScmConnection = 'git://github.com/spring-projects/spring-batch.git'
linkScmDevConnection = 'git@github.com:spring-projects/spring-batch.git'
mainProjects = subprojects.findAll { !it.name.endsWith('tests') && !it.name.endsWith('samples') }
}
allprojects {
group = 'org.springframework.batch'
repositories {
maven { url 'https://repo.spring.io/libs-milestone' }
maven { url 'https://repo.spring.io/plugins-release' }
maven { url "https://repo.spring.io/libs-snapshot" }
maven { url 'https://m2.neo4j.org/content/repositories/releases'}
mavenCentral()
}
ext {
environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql'
springVersionDefault = '4.0.5.RELEASE'
springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault
springRetryVersion = '1.1.0.RELEASE'
springAmqpVersion = '1.3.3.RELEASE'
springDataCommonsVersion = '1.8.0.RELEASE'
springDataGemfireVersion = '1.4.0.RELEASE'
springDataJpaVersion = '1.6.0.RELEASE'
springDataMongodbVersion = '1.5.0.RELEASE'
springDataNeo4jVersion = '3.1.0.RELEASE'
springIntegrationVersion = '4.0.1.RELEASE'
springLdapVersion = '2.0.2.RELEASE'
activemqVersion = '5.9.1'
aspectjVersion = '1.8.0'
castorVersion = '1.3.2'
commonsCollectionsVersion = '3.2.1'
commonsDdbcpVersion = '1.4'
commonsIoVersion = '2.4'
commonsLangVersion = '2.6'
derbyVersion = '10.10.1.1'
groovyVersion = '2.3.0'
hamcrestVersion = '1.3'
h2databaseVersion = '1.3.175'
hibernateVersion = '4.2.12.Final'
hibernateValidatorVersion = '4.3.1.Final'
hsqldbVersion = '2.3.2'
ibatisVersion = '2.3.4.726'
jacksonVersion = '1.9.13'
javaMailVersion = '1.4.7'
javaxBatchApiVersion = '1.0'
javaxInjectVersion = '1'
jbatchTckSpi = '1.0'
jettisonVersion = '1.2'
jtdsVersion = '1.2.4'
junitVersion = '4.11'
log4jVersion = '1.2.17'
mysqlVersion = '5.1.29'
mockitoVersion = '1.9.5'
postgresqlVersion = '9.0-801.jdbc4'
quartzVersion = '2.2.1'
servletApiVersion = '3.0.1'
slf4jVersion = '1.7.7'
sqlfireclientVersion = '1.0.3'
sqliteVersion = '3.7.2'
woodstoxVersion = '4.2.0'
xercesVersion = '2.8.1'
xmlunitVersion = '1.5'
xstreamVersion = '1.4.7'
jrubyVersion = '1.1.7'
beanshellVersion = '2.0b5'
}
}
subprojects { subproject ->
apply plugin: 'java'
apply from: "${rootProject.projectDir}/publish-maven.gradle"
apply plugin: 'jacoco'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
jacoco {
toolVersion = "0.7.0.201403182114"
}
compileJava {
sourceCompatibility=1.6
targetCompatibility=1.6
options.encoding='UTF-8'
}
compileTestJava {
sourceCompatibility=1.7
targetCompatibility=1.7
options.encoding='UTF-8'
}
eclipse {
project {
natures += 'org.springframework.ide.eclipse.core.springnature'
}
}
sourceSets {
test {
resources {
srcDirs = ['src/test/resources', 'src/test/java']
}
}
}
// enable all compiler warnings; individual projects may customize further
ext.xLintArg = '-Xlint:all'
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
tasks.withType(Test).all {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
systemProperty "ENVIRONMENT", environmentProperty
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
include '**/*Tests.class'
exclude '**/Abstract*.class'
}
test {
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task checkTestConfigs << {
def configFiles = []
sourceSets.test.java.srcDirs.each {
fileTree(it).include('**/*.xml').exclude('**/log4j.xml').each { configFile ->
def configXml = new XmlParser(false, false).parse(configFile)
if (configXml.@'xsi:schemaLocation' ==~ /.*spring-[a-z-]*\d\.\d\.xsd.*/) {
configFiles << configFile
}
}
}
if (configFiles) {
throw new InvalidUserDataException('Hardcoded XSD version in the config files:\n' +
configFiles.collect {relativePath(it)}.join('\n') +
'\nPlease, use versionless schemaLocations for Spring XSDs to avoid issues with builds on different versions of dependencies.')
}
}
jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = subproject.name
manifest.attributes["Implementation-Version"] = subproject.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
test.dependsOn checkTestConfigs
artifacts {
archives sourcesJar
archives javadocJar
}
}
configure(mainProjects) {
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"
}
}
}
project('spring-batch-core') {
description = 'Spring Batch Core'
dependencies {
compile project(":spring-batch-infrastructure")
compile "com.ibm.jbatch:com.ibm.jbatch-tck-spi:$jbatchTckSpi"
compile "com.thoughtworks.xstream:xstream:$xstreamVersion"
compile ("org.codehaus.jettison:jettison:$jettisonVersion") {
exclude group: 'stax', module: 'stax-api'
}
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-beans:$springVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile "javax.inject:javax.inject:$javaxInjectVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "com.h2database:h2:$h2databaseVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
testCompile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
optional "org.aspectj:aspectjrt:$aspectjVersion"
optional "org.aspectj:aspectjweaver:$aspectjVersion"
optional "org.springframework:spring-jdbc:$springVersion"
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "log4j:log4j:$log4jVersion"
provided "javax.batch:javax.batch-api:$javaxBatchApiVersion"
}
}
project('spring-batch-infrastructure') {
description = 'Spring Batch Infrastructure'
test {
// permsize settings not passed down from GRADLE_OPTS nor JAVA_OPTS
// when running certain tests causing permgen OOM when using JDK7
// compilation is not performed with JDK6 and permgen is removed
// starting with JDK8..
if (JavaVersion.current().isJava7Compatible()) {
jvmArgs '-XX:MaxPermSize=256m'
}
}
dependencies {
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework.retry:spring-retry:$springRetryVersion"
testCompile "log4j:log4j:$log4jVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "com.h2database:h2:$h2databaseVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
testCompile "org.aspectj:aspectjrt:$aspectjVersion"
testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile "org.xerial:sqlite-jdbc:$sqliteVersion"
testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
testRuntime "org.codehaus.groovy:groovy-jsr223:$groovyVersion"
testRuntime "com.sun.script.jruby:jruby-engine:$jrubyVersion"
testRuntime "org.beanshell:bsh:$beanshellVersion"
optional "javax.jms:jms-api:1.1-rev-1"
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
optional "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
optional "javax.transaction:javax.transaction-api:1.2"
optional "org.apache.ibatis:ibatis-sqlmap:$ibatisVersion"
optional "javax.mail:javax.mail-api:$javaMailVersion"
optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
compile("org.springframework:spring-oxm:$springVersion") { dep ->
optional dep
exclude group: 'commons-lang', module: 'commons-lang'
}
optional "org.springframework:spring-aop:$springVersion"
optional "org.springframework:spring-context:$springVersion"
compile("org.springframework:spring-context-support:$springVersion") { dep ->
optional dep
}
optional "org.springframework:spring-jdbc:$springVersion"
optional "org.springframework:spring-jms:$springVersion"
optional "org.springframework:spring-orm:$springVersion"
optional "org.springframework:spring-tx:$springVersion"
optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
optional "org.springframework.data:spring-data-mongodb:$springDataMongodbVersion"
optional "org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion"
optional "org.springframework.data:spring-data-gemfire:$springDataGemfireVersion"
compile("org.codehaus.woodstox:woodstox-core-asl:$woodstoxVersion") { dep ->
optional dep
exclude group: 'stax', module: 'stax-api'
}
optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
optional "org.springframework.amqp:spring-rabbit:$springAmqpVersion"
optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
}
}
project('spring-batch-core-tests') {
description = 'Spring Batch Core Tests'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-core")
compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework.retry:spring-retry:$springRetryVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
testCompile "log4j:log4j:$log4jVersion"
testCompile "org.springframework:spring-test:$springVersion"
runtime "mysql:mysql-connector-java:$mysqlVersion"
runtime "postgresql:postgresql:$postgresqlVersion"
optional "org.aspectj:aspectjrt:$aspectjVersion"
optional "org.aspectj:aspectjweaver:$aspectjVersion"
optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
}
test {
enabled = project.hasProperty('alltests') ? true : false
}
}
project('spring-batch-infrastructure-tests') {
description = 'Spring Batch Infrastructure Tests'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-infrastructure")
compile "javax.jms:jms-api:1.1-rev-1"
compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
testCompile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
testCompile "org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1"
testCompile "xmlunit:xmlunit:$xmlunitVersion"
testCompile ("org.codehaus.castor:castor-xml:$castorVersion") {
exclude group: 'stax', module: 'stax'
exclude group: 'commons-lang', module: 'commons-lang'
}
testCompile "log4j:log4j:$log4jVersion"
testCompile "xerces:xercesImpl:$xercesVersion"
testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion"
testCompile("org.codehaus.woodstox:woodstox-core-asl:$woodstoxVersion") {
exclude group: 'stax', module: 'stax-api'
}
testCompile "commons-lang:commons-lang:$commonsLangVersion"
testCompile("org.springframework:spring-oxm:$springVersion") {
exclude group: 'commons-lang', module: 'commons-lang'
}
testCompile "org.springframework:spring-jdbc:$springVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "org.apache.ibatis:ibatis-sqlmap:$ibatisVersion"
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
optional "javax.transaction:javax.transaction-api:1.2"
optional "org.springframework:spring-orm:$springVersion"
optional "org.springframework:spring-jms:$springVersion"
runtime "mysql:mysql-connector-java:$mysqlVersion"
runtime "postgresql:postgresql:$postgresqlVersion"
}
test {
enabled = project.hasProperty('alltests') ? true : false
}
}
//Domain for batch job testing
project('spring-batch-test') {
description = 'Spring Batch Test'
dependencies {
compile project(":spring-batch-core")
compile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
compile("org.hamcrest:hamcrest-all:$hamcrestVersion")
compile "org.springframework:spring-test:$springVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "commons-io:commons-io:$commonsIoVersion"
compile "commons-collections:commons-collections:$commonsCollectionsVersion"
testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
optional "org.aspectj:aspectjrt:$aspectjVersion"
optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
}
}
project('spring-batch-integration') {
description = 'Batch Integration'
dependencies {
compile project(":spring-batch-core")
compile "org.springframework.retry:spring-retry:$springRetryVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-messaging:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
compile "org.springframework:spring-tx:$springVersion"
testCompile project(":spring-batch-test")
testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
testCompile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
testCompile "org.aspectj:aspectjrt:$aspectjVersion"
testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
testCompile "com.h2database:h2:$h2databaseVersion"
testCompile "mysql:mysql-connector-java:$mysqlVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.springframework.integration:spring-integration-test:$springIntegrationVersion") {
exclude group: 'junit', module: 'junit-dep'
}
testCompile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion"
optional "javax.jms:jms-api:1.1-rev-1"
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "log4j:log4j:1.2.14"
optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
optional "org.springframework:spring-jms:$springVersion"
}
}
project('spring-batch-samples') {
description = 'Batch Batch Samples'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-core")
compile "org.aspectj:aspectjrt:$aspectjVersion"
compile "org.aspectj:aspectjweaver:$aspectjVersion"
compile "org.quartz-scheduler:quartz:$quartzVersion"
compile "commons-io:commons-io:$commonsIoVersion"
compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
compile "com.thoughtworks.xstream:xstream:$xstreamVersion"
compile("org.codehaus.woodstox:woodstox-core-asl:$woodstoxVersion") {
exclude group: 'stax', module: 'stax-api'
}
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile "javax.transaction:javax.transaction-api:1.2"
compile "org.apache.ibatis:ibatis-sqlmap:$ibatisVersion"
compile "org.springframework:spring-aop:$springVersion"
compile("org.springframework:spring-oxm:$springVersion") {
exclude group: 'commons-lang', module: 'commons-lang'
}
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-context-support:$springVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework:spring-orm:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
compile "javax.mail:javax.mail-api:$javaMailVersion"
testCompile "xmlunit:xmlunit:$xmlunitVersion"
testCompile project(":spring-batch-test")
testCompile("junit:junit:${junitVersion}") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "log4j:log4j:$log4jVersion"
testCompile "org.codehaus.groovy:groovy:$groovyVersion"
testCompile "org.codehaus.groovy:groovy-ant:$groovyVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
provided "mysql:mysql-connector-java:$mysqlVersion"
provided "net.sourceforge.jtds:jtds:$jtdsVersion"
provided "com.h2database:h2:$h2databaseVersion"
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
optional "com.vmware.sqlfire:sqlfireclient:$sqlfireclientVersion"
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "org.apache.derby:derby:$derbyVersion"
optional "postgresql:postgresql:$postgresqlVersion"
optional "org.springframework:spring-web:$springVersion"
optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
optional "org.springframework.amqp:spring-rabbit:$springAmqpVersion"
optional "javax.inject:javax.inject:1"
}
}
apply plugin: 'docbook-reference'
reference {
//sourceDir = file('src/reference/docbook')
sourceDir = file('src/site/docbook/reference')
}
apply plugin: 'sonar-runner'
sonarRunner {
sonarProperties {
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
property "sonar.links.issue", linkIssue
property "sonar.links.scm", linkScmUrl
property "sonar.links.scm_dev", linkScmDevConnection
property "sonar.java.coveragePlugin", "jacoco"
}
}
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.overview = 'src/api/overview.html'
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
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.replaceFirst("${rootProject.name}-", '')
if (subproject.name.endsWith("-core")) {
shortName = ''
}
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 ("batch/${shortName}") {
from xsdFile.path
}
}
}
}
task docsZip(type: Zip) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-batch/reference."
from('src/dist') {
include 'changelog.txt'
}
from (api) {
into 'api'
}
from (reference) {
into 'reference'
}
}
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = 'Distribution'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}";
from('src/dist') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
from(zipTree(docsZip.archivePath)) {
into "${baseDir}/docs"
}
from(zipTree(schemaZip.archivePath)) {
into "${baseDir}/schema"
}
[project(':spring-batch-core'), project(':spring-batch-infrastructure'), project(':spring-batch-test'), project(':spring-batch-integration')].each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
from subproject.sourcesJar
from subproject.javadocJar
}
}
}
// Create an optional "with dependencies" distribution.
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = 'Distribution'
classifier = 'dist-with-deps'
description = "Builds -${classifier} archive, containing everything " +
"in the -${distZip.classifier} archive plus all dependencies."
from zipTree(distZip.archivePath)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":${zipTask.name}")) {
def projectNames = rootProject.subprojects*.name
def artifacts = new HashSet()
subprojects.each { subproject ->
subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectNames.contains(dependency.name)) {
artifacts << artifact.file
}
}
}
zipTask.from(artifacts) {
into "${distZip.baseDir}/deps"
}
}
}
}
artifacts {
archives distZip
archives docsZip
archives schemaZip
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}
task runTck(dependsOn: subprojects.compileJava) {
configurations {
tck {
transitive = true
}
antcp {
transitive = true
exclude module: 'ant'
}
}
dependencies {
tck project(":spring-batch-core")
tck 'commons-pool:commons-pool:1.5.4'
tck "javax.batch:javax.batch-api:$javaxBatchApiVersion"
tck "org.springframework:spring-core:$springVersion"
tck "org.springframework:spring-context:$springVersion"
tck "org.springframework:spring-beans:$springVersion"
tck 'commons-logging:commons-logging-api:1.1'
tck "org.springframework:spring-aop:$springVersion"
tck "org.springframework:spring-tx:$springVersion"
tck "org.springframework.retry:spring-retry:$springRetryVersion"
tck "org.hsqldb:hsqldb:$hsqldbVersion"
tck "org.springframework:spring-jdbc:$springVersion"
tck "com.thoughtworks.xstream:xstream:$xstreamVersion"
tck "org.codehaus.jettison:jettison:$jettisonVersion"
tck "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
tck "org.apache.derby:derby:$derbyVersion"
antcp "ant-contrib:ant-contrib:1.0b3"
}
doLast {
logger.info('tck dependencies: ' + configurations.tck.asPath)
def tckHome = project.hasProperty('TCK_HOME') ? getProperty('TCK_HOME') : System.getenv("JSR_352_TCK_HOME")
assert tckHome : '''\
tckHome is not set. Please set either the environment variable 'JSR_352_TCK_HOME'
or specify the Gradle property `TCK_HOME`, e.g: ./gradlew runTck -PTCK_HOME=/path/to/tck'''
println "Using the JSR 352 TCK at: '$tckHome'"
ant.taskdef resource: "net/sf/antcontrib/antcontrib.properties",
classpath: configurations.antcp.asPath
ant.properties['batch.impl.classes'] = configurations.tck.asPath
ant.ant antfile: "$tckHome/build.xml", target: "run", dir: "$tckHome"
}
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.11'
}