(cherry picked from commit 2d2dca163323d557aed3791d2d1f9a9ed23f01ed) Signed-off-by: John Blum <jblum@pivotal.io>
380 lines
12 KiB
Groovy
380 lines
12 KiB
Groovy
buildscript {
|
|
repositories {
|
|
maven { url 'https://repo.spring.io/plugins-release' }
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0'
|
|
classpath 'org.asciidoctor:asciidoctorj:1.5.0'
|
|
classpath 'org.springframework.build.gradle:bundlor-plugin:0.1.2'
|
|
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.6'
|
|
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.0'
|
|
classpath 'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE'
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
sharedResources
|
|
}
|
|
|
|
apply plugin: "java"
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
apply from: "$rootDir/maven.gradle"
|
|
apply plugin: 'bundlor'
|
|
apply plugin: 'propdeps'
|
|
apply plugin: 'docbook-reference'
|
|
apply plugin: 'org.asciidoctor.gradle.asciidoctor'
|
|
|
|
description = 'Spring Data Geode'
|
|
group = 'org.springframework.data'
|
|
archivesBaseName = project.name
|
|
|
|
sourceCompatibility = 1.6
|
|
targetCompatibility = 1.6
|
|
|
|
[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"]
|
|
|
|
if (project.hasProperty('platformVersion')) {
|
|
apply plugin: 'spring-io'
|
|
|
|
repositories {
|
|
maven { url "https://repo.spring.io/libs-release" }
|
|
}
|
|
|
|
dependencyManagement {
|
|
springIoTestRuntime {
|
|
imports {
|
|
mavenBom "io.spring.platform:platform-bom:${platformVersion}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (JavaVersion.current().isJava8Compatible()) {
|
|
allprojects {
|
|
tasks.withType(Javadoc) {
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(Test).all {
|
|
forkEvery = 1
|
|
systemProperties['gemfire.disableShutdownHook'] = 'true'
|
|
systemProperties['javax.net.ssl.keyStore'] = System.getProperty('user.dir') + '/src/test/resources/trusted.keystore'
|
|
systemProperties['org.springframework.data.gemfire.test.GemfireTestRunner.nomock'] = System.getProperty('org.springframework.data.gemfire.test.GemfireTestRunner.nomock')
|
|
systemProperties['product.name'] = 'Apache Geode'
|
|
systemProperties['spring.profiles.active'] = 'apache-geode'
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
output.resourcesDir = 'build/classes/main'
|
|
output.classesDir = 'build/classes/main'
|
|
}
|
|
test {
|
|
output.resourcesDir = 'build/classes/test'
|
|
output.classesDir = 'build/classes/test'
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven { url "https://repo.spring.io/libs-release" }
|
|
maven { url "https://repo.spring.io/plugins-release"}
|
|
maven { url "https://repository.apache.org/content/repositories/snapshots" }
|
|
}
|
|
|
|
dependencies {
|
|
// Spring Framework
|
|
compile("org.springframework:spring-context-support:$springVersion") {
|
|
exclude group: "commons-logging", module: "commons-logging"
|
|
}
|
|
compile("org.springframework:spring-tx:$springVersion") {
|
|
exclude group: "commons-logging", module: "commons-logging"
|
|
}
|
|
|
|
// Spring Data
|
|
compile("org.springframework.data:spring-data-commons:${springDataCommonsVersion}") {
|
|
exclude group: "commons-logging", module: "commons-logging"
|
|
}
|
|
|
|
// Apache Geode (a.k.a. Pivotal GemFire)
|
|
compile("org.apache.geode:geode-core:$gemfireVersion") {
|
|
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
|
|
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
|
|
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
|
|
exclude group: "org.apache.hbase", module: "hbase"
|
|
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
exclude group: "org.springframework", module: "spring-aop"
|
|
exclude group: "org.springframework", module: "spring-beans"
|
|
exclude group: "org.springframework", module: "spring-context"
|
|
exclude group: "org.springframework", module: "spring-context-support"
|
|
exclude group: "org.springframework", module: "spring-core"
|
|
exclude group: "org.springframework", module: "spring-expression"
|
|
exclude group: "org.springframework", module: "spring-tx"
|
|
exclude group: "org.springframework", module: "spring-web"
|
|
exclude group: "org.springframework", module: "spring-webmvc"
|
|
exclude group: "org.springframework.data", module: "spring-data-commons"
|
|
exclude group: "org.springframework.shell", module: "spring-shell"
|
|
}
|
|
compile("org.apache.geode:geode-cq:$gemfireVersion")
|
|
compile("org.apache.geode:geode-wan:$gemfireVersion")
|
|
optional("com.google.code.findbugs:annotations:2.0.2")
|
|
runtime("antlr:antlr:$antlrVersion")
|
|
|
|
optional "javax.enterprise:cdi-api:$cdiVersion"
|
|
compile "org.aspectj:aspectjweaver:$aspectjVersion"
|
|
compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
|
|
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
|
|
|
|
// Testing
|
|
testCompile "javax.annotation:jsr250-api:1.0", optional
|
|
testCompile("org.springframework:spring-test:$springVersion") {
|
|
exclude group: "commons-logging", module: "commons-logging"
|
|
}
|
|
testCompile "junit:junit:$junitVersion"
|
|
testCompile "org.hamcrest:hamcrest-core:$hamcrestVersion"
|
|
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
|
|
testCompile "org.mockito:mockito-core:$mockitoVersion"
|
|
testCompile "edu.umd.cs.mtc:multithreadedtc:$multiThreadedtcVersion"
|
|
testCompile "org.apache.openwebbeans.test:cditest-owb:$openwebbeansVersion"
|
|
|
|
testRuntime "javax.el:el-api:$cdiVersion"
|
|
testRuntime "javax.servlet:servlet-api:$servletApiVersion"
|
|
testRuntime "log4j:log4j:$log4jVersion"
|
|
testRuntime "org.apache.derby:derbyLocale_zh_TW:10.9.1.0"
|
|
testRuntime "org.slf4j:slf4j-log4j12:$slf4jVersion"
|
|
testRuntime "org.springframework.shell:spring-shell:1.0.0.RELEASE"
|
|
|
|
sharedResources "org.springframework.data.build:spring-data-build-resources:$springDataBuildVersion@zip"
|
|
}
|
|
|
|
bundlor {
|
|
manifestTemplate = file("template.mf").text
|
|
}
|
|
|
|
jar {
|
|
dependsOn = [ 'bundlor' ]
|
|
|
|
manifest.attributes['Implementation-Title'] = project.name
|
|
manifest.attributes['Implementation-Version'] = project.version
|
|
|
|
from("$rootDir/docs/src/info") {
|
|
include "license.txt"
|
|
include "notice.txt"
|
|
into "META-INF"
|
|
expand(copyright: new Date().format('yyyy'), version: project.version)
|
|
}
|
|
}
|
|
|
|
javadoc {
|
|
dependsOn = [ 'extractSharedResources' ]
|
|
destinationDir = file("${buildDir}/api")
|
|
ext.srcDir = file("${projectDir}/docs/src/api")
|
|
ext.tmpDir = file("${buildDir}/api-work")
|
|
|
|
configure(options) {
|
|
stylesheetFile = file("$buildDir/shared-resources/javadoc/spring-javadoc.css")
|
|
docFilesSubDirs = true
|
|
outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
|
|
breakIterator = true
|
|
showFromProtected()
|
|
groups = [
|
|
'Spring GemFire' : ['org.springframework.data.gemfire*'],
|
|
]
|
|
|
|
links = [
|
|
"http://docs.oracle.com/javase/6/docs/api/",
|
|
"http://docs.spring.io/spring/docs/current/javadoc-api/",
|
|
"http://gemfire.docs.pivotal.io/docs-gemfire/latest/javadocs/japi/",
|
|
"http://logging.apache.org/log4j/1.2/apidocs/",
|
|
]
|
|
|
|
exclude "org/springframework/data/gemfire/config/**"
|
|
}
|
|
|
|
title = "${rootProject.description} ${version} API"
|
|
}
|
|
|
|
asciidoctor {
|
|
dependsOn = [ 'extractSharedResources' ]
|
|
backends = [ 'html5', 'docbook' ]
|
|
sourceDir = file("${projectDir}/src/main/asciidoc")
|
|
options = [
|
|
doctype: 'book',
|
|
eruby: 'erubis',
|
|
attributes: [
|
|
basedocdir: "${projectDir}/src/main/asciidoc",
|
|
copycss : "$buildDir/shared-resources/asciidoc/spring.css",
|
|
icons : 'font',
|
|
linkcss: true,
|
|
numbered: true,
|
|
sectanchors : true,
|
|
sectids: false,
|
|
'source-highlighter': 'prettify',
|
|
stylesheet: "spring.css",
|
|
toclevels: '3',
|
|
version: project.version,
|
|
]
|
|
]
|
|
}
|
|
|
|
reference {
|
|
// Avoid copy with expansions
|
|
expandPlaceholders = '';
|
|
}
|
|
|
|
referencePdf {
|
|
dependsOn = [ 'asciidoctor' ]
|
|
sourceDir = asciidoctor.outputDir
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
baseName = project.archivesBaseName
|
|
classifier = 'sources'
|
|
from sourceSets.main.allJava
|
|
}
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
baseName = project.archivesBaseName
|
|
classifier = 'javadoc'
|
|
from javadoc
|
|
}
|
|
|
|
task schemaZip(type: Zip) {
|
|
description = "Builds -${classifier} archive containing all XSDs for deployment"
|
|
baseName = project.archivesBaseName
|
|
classifier = 'schema'
|
|
group = 'Distribution'
|
|
|
|
def Properties schemas = new Properties();
|
|
|
|
sourceSets.main.resources.find {
|
|
it.path.endsWith('META-INF' + File.separator + 'spring.schemas')
|
|
}?.withInputStream { schemas.load(it) }
|
|
|
|
for (def key : schemas.keySet()) {
|
|
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
|
|
def alias = key.replaceAll(/http.*schema.(.*).(spring-.*)/, '$2')
|
|
|
|
assert shortName != key
|
|
|
|
File xsdFile = sourceSets.main.resources.find {
|
|
it.path.replace('\\', '/').endsWith(schemas.get(key))
|
|
}
|
|
|
|
assert xsdFile != null
|
|
|
|
into (shortName) {
|
|
from xsdFile.path
|
|
rename { String fileName -> alias }
|
|
}
|
|
}
|
|
}
|
|
|
|
task docsZip(type: Zip, dependsOn: [javadoc, asciidoctor, referencePdf]) {
|
|
description = "Builds -${classifier} archive containing api and reference for deployment"
|
|
baseName = project.archivesBaseName
|
|
classifier = 'docs'
|
|
group = 'Distribution'
|
|
|
|
from('docs/src/info') {
|
|
include 'changelog.txt'
|
|
}
|
|
|
|
from (javadoc) {
|
|
into 'api'
|
|
}
|
|
|
|
from (asciidoctor.outputDir) {
|
|
include "index.html"
|
|
include "spring.css"
|
|
into 'reference/html'
|
|
}
|
|
|
|
from (referencePdf.outputDir) {
|
|
into 'reference'
|
|
}
|
|
}
|
|
|
|
task distZip(type: Zip, dependsOn: [jar, sourcesJar, javadocJar, schemaZip, docsZip]) {
|
|
description = "Builds -${classifier} archive, containing all jars and docs, " +
|
|
"suitable for community download page."
|
|
|
|
baseName = project.archivesBaseName
|
|
classifier = 'dist'
|
|
group = 'Distribution'
|
|
|
|
ext.zipRootDir = "${project.archivesBaseName}-${project.version}"
|
|
|
|
into (zipRootDir) {
|
|
from('docs/src/info') {
|
|
include 'readme.txt'
|
|
include 'license.txt'
|
|
include 'notice.txt'
|
|
expand(copyright: new Date().format('yyyy'), version: project.version)
|
|
}
|
|
|
|
from('samples/') {
|
|
into 'samples'
|
|
exclude '**/build/**'
|
|
exclude '**/target/**'
|
|
exclude '**/.gradle/**'
|
|
exclude '**/vf*.*'
|
|
exclude '**/vf*.txt'
|
|
}
|
|
|
|
from(zipTree(docsZip.archivePath)) {
|
|
into "docs"
|
|
}
|
|
|
|
from(zipTree(schemaZip.archivePath)) {
|
|
into "schema"
|
|
}
|
|
into ("dist") {
|
|
from rootProject.collect { project -> project.libsDir }
|
|
}
|
|
}
|
|
}
|
|
|
|
task extractSharedResources(type: Copy) {
|
|
from { // use of closure defers evaluation until execution time
|
|
configurations.sharedResources.collect { zipTree(it) }
|
|
}
|
|
|
|
into "$buildDir/shared-resources"
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
archives schemaZip
|
|
archives docsZip
|
|
archives distZip
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
description = "Generates gradlew[.bat] scripts"
|
|
gradleVersion = "1.12"
|
|
|
|
doLast() {
|
|
def gradleOpts = "-Xms256m -Xmx1024m"
|
|
def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=1024m"
|
|
|
|
File wrapperFile = file("gradlew")
|
|
|
|
wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
|
|
"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
|
|
|
|
File wrapperBatFile = file("gradlew.bat")
|
|
|
|
wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
|
|
"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
|
|
}
|
|
}
|
|
|
|
assemble.dependsOn = ['jar', 'sourcesJar']
|
|
defaultTasks 'build'
|