Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit converts the build to a Gradle based build. It also setup sonar integration at https://sonar.springsource.org/dashboard/index/11620 Currently tests in the samples fail on the CI server and are disabled. The tests were not enabled for the maven based build either. Issue: LDAP-251
- Loading branch information
Showing
38 changed files
with
952 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
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 == "spring-ldap-test" } | ||
|
||
configure(allprojects) { | ||
apply plugin: 'eclipse' | ||
apply plugin: 'idea' | ||
apply plugin: 'java' | ||
|
||
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 | ||
} | ||
test.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 "javadoc-api" | ||
} | ||
|
||
from (reference) { | ||
into "spring-ldap-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.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" | ||
} | ||
|
||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
dependencies { | ||
compile project(":spring-ldap-core"), | ||
"org.springframework:spring-tx:$springVersion" | ||
|
||
testCompile "junit:junit:$junitVersion", | ||
"org.easymock:easymock:2.5.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ target | |
.classpath | ||
.project | ||
.settings | ||
.gradle | ||
bin | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apply from: 'javacc.gradle' | ||
|
||
dependencies { | ||
compile "commons-logging:commons-logging:$commonsLoggingVersion", | ||
"commons-lang:commons-lang:$commonsLangVersion", | ||
"org.springframework:spring-core:$springVersion", | ||
"org.springframework:spring-beans:$springVersion", | ||
"org.springframework:spring-tx:$springVersion" | ||
|
||
provided "commons-pool:commons-pool:$commonsPoolVersion", | ||
"com.sun:ldapbp:1.0", | ||
"org.springframework:spring-context:$springVersion", | ||
"org.springframework:spring-jdbc:$springVersion", | ||
"org.springframework:spring-orm:$springVersion" | ||
|
||
testCompile "junit:junit:$junitVersion", | ||
"easymock:easymock:$easyMockVersion", | ||
"gsbase:gsbase:$gsbaseVersion" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
task downloadJavacc { | ||
ext.file = "javacc-5.0.tar.gz" | ||
ext.dest = file("$buildDir/javacc/$file") | ||
ext.url = "https://java.net/downloads/javacc/$file" | ||
|
||
outputs.file dest | ||
|
||
doLast { | ||
dest.parentFile.mkdirs() | ||
new URL(url).withInputStream{ i -> dest.withOutputStream{ it << i }} | ||
} | ||
} | ||
|
||
task installJavacc(type:Copy,dependsOn:downloadJavacc) { | ||
ext.archive = downloadJavacc.dest | ||
ext.javaccHome = file("$buildDir/javacc/") | ||
|
||
inputs.file archive | ||
outputs.dir javaccHome | ||
|
||
if(archive.name.endsWith('.zip')) { | ||
from zipTree(archive) | ||
} else { | ||
from tarTree(archive) | ||
} | ||
into javaccHome | ||
} | ||
|
||
task javacc(dependsOn:installJavacc) { | ||
ext.srcFile = file("src/main/javacc/DnParserImpl.jj") | ||
ext.srcDestDir = file("$buildDir/generated-src/javacc") | ||
ext.destDir = file("$srcDestDir/org/springframework/ldap/core") | ||
ext.homeDir = file("${installJavacc.javaccHome.path}/javacc-5.0") | ||
|
||
inputs.file srcFile | ||
outputs.dir destDir | ||
|
||
doLast { | ||
destDir.mkdirs() | ||
ant.javacc (target:"src/main/javacc/DnParserImpl.jj", outputdirectory : destDir, javacchome: homeDir) | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDir project.javacc.srcDestDir | ||
} | ||
} | ||
} | ||
|
||
sourcesJar { | ||
from javacc.srcDestDir | ||
include "**/*.java" | ||
} | ||
|
||
sourcesJar.dependsOn javacc | ||
compileJava.dependsOn javacc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version=1.3.2.CI-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apply from: JAVA_SCRIPT | ||
apply from: MAVEN_DEPLOYMENT_SCRIPT | ||
|
||
configurations { | ||
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo | ||
} | ||
|
||
dependencies { | ||
jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.6.2.201302030002", classifier: "runtime" | ||
} | ||
|
||
test { | ||
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*" | ||
} | ||
|
||
jar { | ||
manifest.attributes["Created-By"] = | ||
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})" | ||
manifest.attributes["Implementation-Title"] = project.name | ||
manifest.attributes["Implementation-Version"] = project.version | ||
|
||
from("${rootProject.projectDir}/src/dist") { | ||
include "license.txt" | ||
include "notice.txt" | ||
into "META-INF" | ||
expand(copyright: new Date().format("yyyy"), version: project.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) | ||
|
||
// suppress warnings due to cross-module @see and @link references; | ||
// note that global 'api' task does display all warnings. | ||
logging.captureStandardError LogLevel.INFO | ||
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn:classes) { | ||
description = "Generates the -sources.jar" | ||
|
||
classifier = "sources" | ||
from sourceSets.main.allJava.srcDirs | ||
include "**/*.java", "**/*.aj" | ||
} | ||
assemble.dependsOn sourcesJar | ||
|
||
task javadocJar(type: Jar) { | ||
description = "Generates the -javadoc.jar" | ||
|
||
classifier = "javadoc" | ||
from javadoc | ||
} | ||
assemble.dependsOn javadocJar | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives javadocJar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'propdeps' | ||
|
||
sourceCompatibility = '1.5' | ||
targetCompatibility = '1.5' | ||
|
||
ext.springVersion = '3.0.5.RELEASE' | ||
ext.springBatchVersion = '2.0.3.RELEASE' | ||
ext.junitVersion = '4.8.2' | ||
ext.commonsPoolVersion = '1.5.4' | ||
ext.commonsLangVersion = '2.4' | ||
ext.commonsLoggingVersion = '1.0.4' | ||
ext.easyMockVersion = '1.2_Java1.3' | ||
ext.gsbaseVersion = '2.0.1' | ||
ext.log4jVersion = '1.2.9' | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
Oops, something went wrong.