This repository has been archived by the owner on Jun 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
/
build.gradle
363 lines (310 loc) · 11.1 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
buildscript {
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
classpath("org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE")
classpath('org.asciidoctor:asciidoctor-gradle-plugin:0.7.0')
classpath('org.asciidoctor:asciidoctor-java-integration:0.1.4.preview.1')
classpath("me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1")
}
}
// Set up different subproject lists for individual configuration
ext.javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'manual' }
ext.docProjects = subprojects.findAll { project -> project.name == 'docs' || project.name == 'manual' }
ext.coreModuleProjects = javaProjects
configure(allprojects) {
group = "org.springframework.sync"
ext.springVersion = "4.0.7.RELEASE"
ext.springReleaseVersion = "latest.release"
ext.springSnapshotVersion = "latest.integration"
ext.springAndroidVersion = "2.0.0.BUILD-SNAPSHOT"
ext.commonsLangVersion = "2.6"
ext.diffUtilsVersion = "1.2.1"
ext.slf4jVersion = "1.7.6"
ext.jacksonVersion = "2.4.3"
ext.springDataRedisVersion = "1.4.0.RELEASE"
ext.springDataGemfireVersion = "1.5.0.RELEASE"
ext.springDataCommonsVersion = "1.9.0.RELEASE"
ext.springDataJpaVersion = "1.7.0.RELEASE"
ext.jsonPathVersion = "0.8.1"
ext.junitVersion = "4.12"
ext.easymockVersion = "3.2"
ext.hamcrestVersion = "1.3"
ext.servletApiVersion = "3.0.1"
apply plugin: "propdeps"
apply plugin: "propdeps-eclipse"
apply plugin: "propdeps-idea"
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "javadocHotfix"
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 {
sourceCompatibility=1.6
targetCompatibility=1.6
}
compileTestJava {
sourceCompatibility=1.7
targetCompatibility=1.7
}
[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-snapshot" }
}
dependencies {
testCompile("org.springframework:spring-test:${springVersion}")
testCompile("junit:junit:${junitVersion}")
testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
testCompile("org.easymock:easymock:${easymockVersion}")
}
ext.javadocLinks = [
"http://docs.oracle.com/javase/7/docs/api/",
"http://docs.oracle.com/javaee/7/api/",
"http://docs.spring.io/spring/docs/${springVersion}/javadoc-api/",
"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/"
] as String[]
// servlet-api (2.5) and tomcat-servlet-api (3.0) classpath entries should not be
// exported to dependent projects in Eclipse to avoid false compilation errors due
// to changing APIs across these versions
eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.findAll { entry -> entry.path.contains("servlet-api") }*.exported = false
}
}
configure(subprojects) { subproject ->
apply from: "${rootProject.projectDir}/publish-maven.gradle"
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"
}
}
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
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)
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
configurations {
springReleaseTestRuntime.extendsFrom testRuntime
springSnapshotTestRuntime.extendsFrom testRuntime
}
// Test against latest Spring Framework release
configurations.springReleaseTestRuntime {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion springReleaseVersion
}
}
}
// Test against latest Spring Framework snapshot
configurations.springSnapshotTestRuntime {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion springSnapshotVersion
}
}
}
task springReleaseTest(type: Test) {
classpath = sourceSets.test.output + sourceSets.main.output + configurations.springReleaseTestRuntime
getReports().getJunitXml().setDestination(file("$buildDir/spring-release-test-results/"))
getReports().getHtml().setDestination(file("$buildDir/reports/spring-release-tests/"))
}
check.dependsOn springReleaseTest
task springSnapshotTest(type: Test) {
classpath = sourceSets.test.output + sourceSets.main.output + configurations.springSnapshotTestRuntime
getReports().getJunitXml().setDestination(file("$buildDir/spring-snapshot-test-results/"))
getReports().getHtml().setDestination(file("$buildDir/reports/spring-snapshot-tests/"))
}
check.dependsOn springSnapshotTest
configure([test, springReleaseTest, springSnapshotTest]) {
systemProperties['springVersion'] = springVersion
}
}
project('spring-sync-core') {
description = "Spring Differential Synchronization and JSON Patch"
dependencies {
compile("org.springframework:spring-core:${springVersion}")
compile("org.springframework:spring-expression:${springVersion}")
compile("commons-lang:commons-lang:${commonsLangVersion}")
compile("com.googlecode.java-diff-utils:diffutils:${diffUtilsVersion}")
compile("org.slf4j:slf4j-api:${slf4jVersion}")
optional("org.springframework.data:spring-data-redis:${springDataRedisVersion}")
optional("org.springframework.data:spring-data-gemfire:${springDataGemfireVersion}")
optional("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
testCompile("com.jayway.jsonpath:json-path:${jsonPathVersion}")
testCompile("com.jayway.jsonpath:json-path-assert:${jsonPathVersion}")
}
}
project('spring-sync-config') {
description = "Spring Sync Configuration"
dependencies {
compile(project(":spring-sync-core"))
compile(project(":spring-sync-web"))
compile("org.springframework:spring-core:${springVersion}")
compile("org.springframework:spring-context:${springVersion}")
optional("javax.servlet:javax.servlet-api:${servletApiVersion}")
}
}
project('spring-sync-core-android') {
description = "Spring Differential Synchronization and JSON Patch for Android"
// creates a separate artifact for Android which builds against different dependencies
sourceSets {
main {
java {
srcDir '../spring-sync-core/src/main/java'
exclude 'org/springframework/sync/diffsync/shadowstore/Redis**'
exclude 'org/springframework/sync/diffsync/shadowstore/Gem**'
}
}
}
dependencies {
compile("org.springframework.android:spring-android-core:${springAndroidVersion}")
compile("org.springframework:spring-expression:3.2.11.RELEASE") {
// exclude in favor of Spring for Android Core
exclude group: "org.springframework", module: "spring-core"
}
compile("commons-lang:commons-lang:${commonsLangVersion}")
compile("com.googlecode.java-diff-utils:diffutils:${diffUtilsVersion}")
optional("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
}
}
project('spring-sync-web') {
description = "Spring Differential Synchronization and JSON Patch"
dependencies {
compile(project(":spring-sync-core"))
compile("org.springframework:spring-webmvc:${springVersion}")
optional("javax.servlet:javax.servlet-api:${servletApiVersion}")
optional("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
testCompile("org.hibernate:hibernate-entitymanager:4.3.5.Final")
testCompile("com.h2database:h2:1.4.180")
testCompile("org.springframework.data:spring-data-commons:${springDataCommonsVersion}")
testCompile("org.springframework.data:spring-data-jpa:${springDataJpaVersion}")
testCompile("org.springframework:spring-orm:${springVersion}")
testCompile("com.jayway.jsonpath:json-path:${jsonPathVersion}")
testCompile("com.jayway.jsonpath:json-path-assert:${jsonPathVersion}")
}
}
configure(rootProject) {
description = "Spring Sync"
// 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.overview = "src/api/overview.html"
options.links(project.ext.javadocLinks)
if (JavaVersion.current().isJava8Compatible()) {
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 for creating the distro zip
task dist(type: Zip) {
dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' || task.name.endsWith('Zip') || task.name.endsWith('generatePom') }
classifier = 'dist'
evaluationDependsOn(':docs')
evaluationDependsOn(':docs:manual')
def zipRootDir = "${project.name}-$version"
into(zipRootDir) {
from(rootDir) {
include '*.txt'
}
into('docs') {
with(project(':docs').apiSpec)
with(project(':docs:manual').spec)
}
into('dist') {
from coreModuleProjects.collect {project -> project.libsDir }
}
}
}
artifacts {
archives dist
archives project(':docs').docsZip
}
task wrapper(type: Wrapper) {
gradleVersion = "1.12"
}
}