237 lines
5.6 KiB
Groovy
237 lines
5.6 KiB
Groovy
buildscript {
|
|
repositories {
|
|
maven { url "https://repo.spring.io/plugins-release" }
|
|
}
|
|
dependencies {
|
|
classpath("io.spring.gradle:propdeps-plugin:0.0.10.RELEASE")
|
|
classpath("io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE")
|
|
classpath("io.spring.gradle:spring-io-plugin:0.0.8.RELEASE")
|
|
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
|
|
}
|
|
}
|
|
|
|
configure(allprojects) {
|
|
group = "org.springframework.cloud.appbroker"
|
|
|
|
if (!project.hasProperty("springVersion")) {
|
|
ext.springVersion = "5.0.5.RELEASE"
|
|
}
|
|
if (!project.hasProperty("springBootVersion")) {
|
|
ext.springBootVersion = "2.0.1.RELEASE"
|
|
}
|
|
|
|
apply plugin: "java"
|
|
apply plugin: "maven"
|
|
apply plugin: "eclipse"
|
|
apply plugin: "idea"
|
|
apply plugin: "propdeps"
|
|
apply plugin: "propdeps-maven"
|
|
apply plugin: "propdeps-idea"
|
|
apply plugin: "propdeps-eclipse"
|
|
apply plugin: "io.spring.dependency-management"
|
|
|
|
if (project.hasProperty("springVersion") || project.hasProperty("springBootVersion")) {
|
|
repositories {
|
|
maven { url "https://repo.spring.io/libs-snapshot" }
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty('platformVersion')) {
|
|
apply plugin: 'spring-io'
|
|
|
|
repositories {
|
|
maven { url "https://repo.spring.io/libs-snapshot" }
|
|
}
|
|
|
|
dependencyManagement {
|
|
springIoTestRuntime {
|
|
imports {
|
|
mavenBom "io.spring.platform:platform-bom:${platformVersion}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
compileJava {
|
|
sourceCompatibility=1.8
|
|
targetCompatibility=1.8
|
|
options.encoding = "UTF-8"
|
|
}
|
|
compileTestJava {
|
|
sourceCompatibility=1.8
|
|
targetCompatibility=1.8
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
[compileJava, compileTestJava]*.options*.compilerArgs = [
|
|
"-Xlint:serial",
|
|
"-Xlint:varargs",
|
|
"-Xlint:cast",
|
|
"-Xlint:classfile",
|
|
"-Xlint:dep-ann",
|
|
"-Xlint:divzero",
|
|
"-Xlint:empty",
|
|
"-Xlint:finally",
|
|
"-Xlint:overrides",
|
|
"-Xlint:path",
|
|
"-Xlint:-processing",
|
|
"-Xlint:static",
|
|
"-Xlint:try",
|
|
"-Xlint:fallthrough",
|
|
"-Xlint:rawtypes",
|
|
"-Xlint:deprecation",
|
|
"-Xlint:unchecked",
|
|
"-Xlint:-options",
|
|
"-Werror"
|
|
]
|
|
|
|
sourceSets.test.resources.srcDirs = [
|
|
"src/test/resources",
|
|
"src/test/java"
|
|
]
|
|
|
|
tasks.withType(Test).all {
|
|
systemProperty("java.awt.headless", "true")
|
|
}
|
|
|
|
repositories {
|
|
maven { url "https://repo.spring.io/libs-milestone" }
|
|
}
|
|
|
|
ext.javadocLinks = [
|
|
"http://docs.oracle.com/javase/8/docs/api/",
|
|
"http://docs.spring.io/spring/docs/${springVersion}/javadoc-api/",
|
|
] as String[]
|
|
}
|
|
|
|
subprojects { subproject ->
|
|
apply from: "${rootProject.projectDir}/publish-maven.gradle"
|
|
|
|
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
|
|
}
|
|
|
|
javadoc {
|
|
description = "Generates project-level javadoc for use in -javadoc jar"
|
|
|
|
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
|
|
options.author = true
|
|
options.header = project.name
|
|
options.links(project.ext.javadocLinks)
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn:classes) {
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
classifier = "sources"
|
|
from sourceSets.main.allJava
|
|
}
|
|
|
|
task javadocJar(type: Jar) {
|
|
classifier = "javadoc"
|
|
from javadoc
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
}
|
|
|
|
project("spring-cloud-app-broker-core") {
|
|
description = "Spring Cloud App Broker Core"
|
|
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom "org.springframework:spring-framework-bom:${springVersion}"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile("org.springframework:spring-core")
|
|
testCompile("org.springframework:spring-test") {
|
|
exclude group:"commons-logging", module:"commons-logging"
|
|
}
|
|
testCompile("junit:junit:4.12") {
|
|
exclude group:"org.hamcrest", module:"hamcrest-core"
|
|
}
|
|
}
|
|
}
|
|
|
|
configure(rootProject) {
|
|
description = "Spring Cloud App Broker"
|
|
|
|
// don't publish the default jar for the root project
|
|
configurations.archives.artifacts.clear()
|
|
|
|
dependencies {
|
|
// for integration tests
|
|
}
|
|
|
|
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)
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
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."
|
|
|
|
from (api) { into "api" }
|
|
}
|
|
|
|
task distZip(type: Zip, dependsOn: docsZip) {
|
|
group = "Distribution"
|
|
classifier = "dist"
|
|
description = "Builds -${classifier} archive, containing all jars and docs, " +
|
|
"suitable for community download page."
|
|
|
|
def baseDir = "${project.name}-${project.version}";
|
|
|
|
from(zipTree(docsZip.archivePath)) { into "${baseDir}/docs" }
|
|
|
|
subprojects.each { subproject ->
|
|
into ("${baseDir}/libs") {
|
|
from subproject.jar
|
|
if (subproject.tasks.findByPath("sourcesJar")) {
|
|
from subproject.sourcesJar
|
|
}
|
|
if (subproject.tasks.findByPath("javadocJar")) {
|
|
from subproject.javadocJar
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
archives docsZip
|
|
archives distZip
|
|
}
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = "4.7"
|
|
}
|