Files
spring-shell/build.gradle
Andy Wilkinson 880bc35d55 Add the Spring IO plugin and align with the Platform where possible
Configure the Spring IO plugin such that it's only applied when the
build is run with -PplatformVersion=<version>. 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.
2014-11-28 14:55:28 +01:00

216 lines
5.6 KiB
Groovy

buildscript {
repositories {
maven { url 'http://repo.springsource.org/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5'
classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE'
}
}
description = 'Spring Shell'
group = 'org.springframework.shell'
repositories {
mavenCentral()
maven { url "http://repo.springsource.org/libs-snapshot" }
maven { url "http://repo.springsource.org/plugins-release" }
}
apply plugin: "java"
apply plugin: 'eclipse'
apply plugin: 'idea'
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:$guavaVersion"
compile "jline:jline:$jlineVersion"
// Testing
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "uk.co.modular-it:hamcrest-date:$hamcrestDateVersion"
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
javadoc {
ext.srcDir = file("${projectDir}/docs/src/api")
destinationDir = file("${buildDir}/api")
ext.tmpDir = file("${buildDir}/api-work")
configure(options) {
stylesheetFile = file("${srcDir}/spring-javadoc.css")
overview = "${srcDir}/overview.html"
docFilesSubDirs = true
outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
breakIterator = true
showFromProtected()
groups = [
'Spring Shell' : ['org.springframework.shell*'],
]
links = [
"http://static.springframework.org/spring/docs/3.1.x/javadoc-api",
"http://download.oracle.com/javase/6/docs/api",
]
//exclude "org/springframework/data/redis/config/**"
}
title = "${rootProject.description} ${version} API"
}
jar {
manifest.attributes['Implementation-Title'] = 'spring-shell'
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)
}
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
reference {
sourceDir = file('docs/src/reference/docbook')
}
task docsZip(type: Zip) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference for deployment"
from('docs/src/info') {
include 'changelog.txt'
}
from (javadoc) {
into 'api'
}
from (reference) {
into 'reference'
}
}
task schemaZip(type: Zip) {
group = 'Distribution'
classifier = 'schema'
description = "Builds -${classifier} archive containing all XSDs for deployment"
def Properties schemas = new Properties();
sourceSets.main.resources.find {
it.path.endsWith('META-INF' + File.separator + 'spring.schemas')
}?.withInputStream { schemas.load(it) }
ext.paths = [] as Set
for (def key : schemas.keySet()) {
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
assert shortName != key
File xsdFile = sourceSets.main.resources.find {
it.path.replace('\\', '/').endsWith(schemas.get(key))
}
assert xsdFile != null
def input = xsdFile.path
if (!paths.contains(input)) {
paths.add(input)
into (shortName) {
from input
}
}
}
}
task distroZip(type: Zip, dependsOn: [jar, docsZip, sourcesJar, javadocJar]) {
group = 'Distribution'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.zipRootDir = "${project.name}-${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 '.gradle/'
exclude 'build/'
}
from(zipTree(docsZip.archivePath)) {
into "docs"
}
// from(zipTree(schemaZip.archivePath)) {
// into "schema"
// }
into ("dist") {
from rootProject.collect { project -> project.libsDir }
}
}
}
artifacts {
archives sourcesJar
archives javadocJar
archives docsZip
// archives schemaZip
archives distroZip
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.2'
}
mainClassName = "org.springframework.shell.Bootstrap"
assemble.dependsOn = ['jar', 'sourcesJar']
defaultTasks 'build'