forked from spring-projects/spring-ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
203 lines (169 loc) · 6.24 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
buildscript {
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.3")
classpath('org.asciidoctor:asciidoctor-gradle-plugin:0.7.0')
classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE'
}
}
apply plugin: "asciidoctor"
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.RELEASE_CHECKS_SCRIPT = "${GRADLE_SCRIPT_DIR}/release-checks.gradle"
ext.SAMPLE_WAR_GRADLE = "${GRADLE_SCRIPT_DIR}/sample-war.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'
apply plugin: 'groovy'
group = "org.springframework.ldap"
ext.releaseBuild = version.endsWith('RELEASE')
ext.snapshotBuild = version.endsWith('SNAPSHOT')
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.exclusions", "file:**/generated-src/**"
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-B20X'
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'
}
}
asciidoctor {
outputDir = new File("$buildDir/docs")
options = [
eruby: 'erubis',
attributes: [
copycss : '',
icons : 'font',
'source-highlighter': 'prettify',
sectanchors : '',
toc2: '',
idprefix: '',
idseparator: '-',
doctype: 'book',
numbered: '',
'spring-ldap-version' : project.version,
revnumber : project.version
]
]
}
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, dependsOn: asciidoctor) {
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 (asciidoctor.outputDir) {
include "*.html"
into "reference"
}
}
task schemaZip(type: Zip) {
group = 'Distribution'
baseName = rootProject.name
classifier = 'schema'
description = "Builds -${classifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
coreModules.each { module ->
def Properties schemas = new Properties();
module.sourceSets.main.resources.find {
it.path.endsWith('META-INF/spring.schemas')
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
assert shortName != key
File xsdFile = module.sourceSets.main.resources.find {
it.path.endsWith(schemas.get(key))
}
assert xsdFile != null
into (shortName) {
from xsdFile.path
}
}
}
}
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
archives schemaZip
}