forked from spring-cloud/spring-cloud-connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
214 lines (177 loc) · 5.14 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
apply plugin: 'base'
description = "Spring Cloud Connectors"
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
classpath 'io.spring.gradle:spring-io-plugin:0.0.8.RELEASE'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.12'
classpath 'io.spring.nohttp:nohttp-gradle:0.0.1.RELEASE'
}
}
ext {
junitVersion = "4.12"
mockitoVersion = "2.7.22"
javadocLinks = [
'https://docs.oracle.com/javase/8/docs/api/',
'https://docs.spring.io/spring/docs/current/javadoc-api/',
'https://docs.spring.io/spring-amqp/docs/latest-ga/api/',
'https://docs.spring.io/spring-data/data-mongo/docs/current/api/',
'https://docs.spring.io/spring-data/data-redis/docs/current/api/'
] as String[]
}
apply plugin: 'io.spring.nohttp'
checkstyle {
toolVersion = 8.16
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
apply plugin: "org.asciidoctor.gradle.asciidoctor"
asciidoctor {
sourceDir = new File("docs/src/main/asciidoc")
outputDir = new File("docs/target/generated-docs")
options = [
'doctype': 'book'
]
attributes = [
'source-highlighter': 'coderay'
]
}
apply from: "${rootProject.projectDir}/publish-maven.gradle"
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
// necessary to resolve the Spring IO versions (which may include snapshots)
repositories {
maven { url "https://repo.spring.io/libs-snapshot" }
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${platformVersion}"
}
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
javadoc {
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
}
task packageSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives packageSources
archives javadocJar
}
dependencies {
testCompile("junit:junit:$junitVersion")
testCompile("org.mockito:mockito-core:$mockitoVersion")
}
repositories {
mavenCentral()
}
}
configure(rootProject) {
task schemaZip(type: Zip) {
group = 'Distribution'
classifier = 'schema'
description = "Builds -${classifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
subprojects.each { subproject ->
def Properties schemas = new Properties();
def shortName = subproject.name
subproject.sourceSets.main.resources.find {
it.path.endsWith('META-INF/spring.schemas')
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
File xsdFile = subproject.sourceSets.main.resources.find {
it.path.endsWith(schemas.get(key))
}
assert xsdFile != null
into("cloud") {
from xsdFile.path
}
}
}
}
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)
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 at docs.spring.io/spring-cloud/docs."
from(api) {
into 'api'
}
}
artifacts {
archives docsZip
archives schemaZip
}
repositories {
mavenCentral()
}
}
ext {
matrix = [
"driver34-mongo20" : [mongoDriverVersion: "3.4.2", springDataMongoVersion: "2.0.0.RELEASE"],
"jedis29-redis20" : [jedisVersion: "2.9.0", springDataRedisVersion: "2.0.0.RELEASE"],
"lettuce5-redis20" : [lettuceVersion: "5.0.0.RELEASE", springDataRedisVersion: "2.0.0.RELEASE"],
"driver330-cass20" : [cassandraDriverVersion: "3.3.0", springDataCassandraVersion: "2.0.0.RELEASE"],
"amqp200" : [springAmqpVersion: "2.0.0.RELEASE"],
"amqp205-rabbit541" : [springAmqpVersion: "2.0.5.RELEASE", "rabbitClientVersion": "5.4.1"],
"spring50" : [springVersion: "5.0.0.RELEASE"],
"tomcat85" : [tomcatVersion: "8.5.13"],
]
}
task matrixTests
task defineMatrixTests {
def createTestTask = { name, props ->
task "$name"(type: GradleBuild) {
tasks = ['test']
startParameter.projectProperties = props
}
}
matrix.each { sp ->
def testTask = createTestTask(sp.key, sp.value)
matrixTests.dependsOn(testTask.name)
}
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}