This is necessary so that the Gradle builds can be promoted. Otherwise an error like the following is displayed when promoting the build: HTTP Status 400 - Unable to find artifact 'spring-ldap-article-sample-1.3.2.RELEASE.war'
153 lines
4.5 KiB
Groovy
153 lines
4.5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
maven { url "http://repo.springsource.org/plugins-release" }
|
|
}
|
|
dependencies {
|
|
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.3")
|
|
classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.6")
|
|
}
|
|
}
|
|
|
|
apply plugin: "docbook-reference"
|
|
apply plugin: "sonar-runner"
|
|
|
|
ext.GRADLE_SCRIPT_DIR = "${rootProject.projectDir}/gradle"
|
|
ext.JAVA_MODULE_SCRIPT = "${GRADLE_SCRIPT_DIR}/java-module.gradle"
|
|
ext.MAVEN_DEPLOYMENT_SCRIPT = "${GRADLE_SCRIPT_DIR}/maven-deployment.gradle"
|
|
ext.JAVA_SCRIPT = "${GRADLE_SCRIPT_DIR}/java.gradle"
|
|
|
|
ext.coreModules = subprojects.findAll { p-> (!p.name.contains("test") && !p.name.contains("sample") && !p.name.contains("sandbox")) || p.name == "spring-ldap-test" }
|
|
|
|
configure(allprojects) {
|
|
apply plugin: 'propdeps'
|
|
apply plugin: 'propdeps-idea'
|
|
apply plugin: 'propdeps-eclipse'
|
|
|
|
group = "org.springframework.ldap"
|
|
|
|
ext.javadocLinks = [
|
|
"http://download.oracle.com/javase/1.5.0/docs/api",
|
|
"http://static.springframework.org/spring/docs/3.0.x/api/",
|
|
"http://logging.apache.org/log4j/1.2/apidocs/",
|
|
"http://commons.apache.org/logging/apidocs/",
|
|
"http://commons.apache.org/dbcp/apidocs/",
|
|
"http://commons.apache.org/pool/apidocs/",
|
|
"http://junit.sourceforge.net/javadoc/",
|
|
] as String[]
|
|
}
|
|
|
|
configure(coreModules) {
|
|
apply from: JAVA_MODULE_SCRIPT
|
|
}
|
|
|
|
configure(subprojects - coreModules) {
|
|
sonarRunner {
|
|
skipProject = true
|
|
}
|
|
|
|
tasks.findByPath("artifactoryPublish")?.enabled = false
|
|
}
|
|
|
|
description = "Spring LDAP"
|
|
|
|
configurations.archives.artifacts.clear()
|
|
|
|
sonarRunner {
|
|
sonarProperties {
|
|
property "sonar.java.coveragePlugin", "jacoco"
|
|
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
|
property "sonar.links.homepage", 'https://github.com/SpringSource/spring-ldap'
|
|
property "sonar.links.ci", 'https://build.springsource.org/browse/LDAP-1.3.x'
|
|
property "sonar.links.issue", 'https://jira.springsource.org/browse/LDAP'
|
|
property "sonar.links.scm", 'https://github.com/SpringSource/spring-ldap'
|
|
property "sonar.links.scm_dev", 'https://github.com/SpringSource/spring-ldap.git'
|
|
property "sonar.java.coveragePlugin", "jacoco"
|
|
}
|
|
}
|
|
|
|
reference {
|
|
sourceDir = file("src/docbkx")
|
|
pdfFilename = "spring-ldap-reference.pdf"
|
|
}
|
|
|
|
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.splitIndex = true
|
|
options.links(project.ext.javadocLinks)
|
|
|
|
maxMemory = "1024m"
|
|
destinationDir = new File(buildDir, "api")
|
|
|
|
source coreModules*.javadoc*.source
|
|
classpath = files(coreModules*.javadoc*.classpath)
|
|
}
|
|
|
|
task docsZip(type: Zip) {
|
|
group = "Distribution"
|
|
baseName = "spring-ldap"
|
|
classifier = "docs"
|
|
description = "Builds -${classifier} archive containing api and reference " +
|
|
"for deployment at http://static.springframework.org/spring-ldap/docs."
|
|
|
|
from("src/dist") {
|
|
include "changelog.txt"
|
|
}
|
|
|
|
from (api) {
|
|
into "apidocs"
|
|
}
|
|
|
|
from (reference) {
|
|
into "reference"
|
|
}
|
|
}
|
|
|
|
|
|
task distZip(type: Zip, dependsOn: [docsZip]) {
|
|
dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' }
|
|
|
|
group = "Distribution"
|
|
baseName = "spring-ldap"
|
|
classifier = "dist"
|
|
description = "Builds -${classifier} archive, containing all jars and docs, " +
|
|
"suitable for community download page."
|
|
|
|
ext.baseDir = "${baseName}-${project.version}"
|
|
|
|
|
|
from("src/dist") {
|
|
include "readme.md"
|
|
include "license.txt"
|
|
include "notice.txt"
|
|
into "${baseDir}"
|
|
expand(copyright: new Date().format("yyyy"), version: project.version)
|
|
}
|
|
|
|
from(zipTree(docsZip.archivePath)) {
|
|
into "${baseDir}/docs"
|
|
}
|
|
|
|
coreModules.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
|
|
}
|