forked from reactor/reactor-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
312 lines (254 loc) · 7.82 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
/*
* Copyright (c) 2011-2017 Pivotal Software Inc, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories {
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7',
'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE',
'com.github.jengelman.gradle.plugins:shadow:1.2.0',
'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11'
}
}
plugins {
id 'org.asciidoctor.convert' version '1.5.2'
id "me.champeau.gradle.jmh" version "0.3.1" apply false
}
apply from: "gradle/doc.gradle"
apply from: "gradle/setup.gradle"
ext {
gradleVersion = '3.5'
// Logging
slf4jVersion = '1.7.12'
logbackVersion = '1.1.2'
// Testing
assertJVersion = '3.6.1'
mockitoVersion = '2.7.22'
javadocLinks = ["http://docs.oracle.com/javase/8/docs/api/",
"http://docs.oracle.com/javaee/6/api/",
"http://www.reactive-streams.org/reactive-streams-1.0.0-javadoc/"] as String[]
bundleImportPackages = ['org.slf4j;resolution:=optional;version="[1.5.4,2)"',
'rx;resolution:=optional',
'com.google;resolution:=optional',
'*']
}
configure(subprojects) { p ->
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'propdeps'
apply plugin: 'osgi'
description = 'Non-Blocking Reactive Foundation for the JVM'
group = 'io.projectreactor'
repositories {
mavenLocal()
if (version.endsWith('BUILD-SNAPSHOT') || project.hasProperty('platformVersion')) {
maven { url 'http://repo.spring.io/libs-snapshot' }
}
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/libs-milestone' }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
jacoco {
toolVersion = '0.7.7.201606060606'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.compilerArgs =
["-Xlint:-varargs", // intentionally disabled
"-Xlint:cast",
"-Xlint:classfile",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:static",
"-Xlint:try",
"-Xlint:deprecation",
"-Xlint:unchecked",
"-Xlint:-serial", // intentionally disabled
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:-rawtypes" // TODO enable and fix warnings
]
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
if (JavaVersion.current().isJava8Compatible()) {
compileTestJava.options.compilerArgs += "-parameters"
p.tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
test {
testLogging {
events "passed", "failed"
showExceptions true
exceptionFormat "full"
maxGranularity 3
}
}
p.tasks.withType(Test).all {
systemProperty("java.awt.headless", "true")
systemProperty("reactor.trace.cancel", "true")
systemProperty("reactor.trace.nocapacity", "true")
systemProperty("testGroups", p.properties.get("testGroups"))
scanForTestClasses = false
include '**/*Tests.*'
include '**/*Test.*'
include '**/*Spec.*'
if (!version.contains("SNAPSHOT")) {
include '**/*Loop.*'
}
exclude '**/*Abstract*.*'
exclude '**/*OperatorTest*.*'
}
}
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:$platformVersion"
}
}
}
}
project('reactor-core') {
apply plugin: 'idea' //needed to avoid IDEA seeing the jmh folder as source
apply plugin: 'me.champeau.gradle.jmh'
configurations {
compileOnly.extendsFrom jsr166backport
testCompile.extendsFrom jsr166backport
}
dependencies {
// Reactive Streams
compile "org.reactivestreams:reactive-streams:1.0.0"
testCompile "org.reactivestreams:reactive-streams-tck:1.0.0"
// JSR-305 annotations
optional "com.google.code.findbugs:jsr305:3.0.0"
//Optional Logging Operator
optional "org.slf4j:slf4j-api:$slf4jVersion"
//Optional JDK 9 Converter
jsr166backport "io.projectreactor:jsr166:1.0.0.RELEASE"
testCompile 'junit:junit:4.12'
testRuntime "ch.qos.logback:logback-classic:$logbackVersion"
// Testing
testCompile(project(":reactor-test")) {
exclude module: 'reactor-core'
}
testCompile "org.hamcrest:hamcrest-library:1.3",
"org.testng:testng:6.8.5",
"org.assertj:assertj-core:$assertJVersion",
"org.mockito:mockito-core:$mockitoVersion"
}
javadoc {
dependsOn jar
group = "Reactor Core Javadoc"
description = "Generates aggregated Javadoc API documentation."
title = "Reactor Core $version"
options.addStringOption('charSet', 'UTF-8')
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = "$project.name"
options.overview = "$rootDir/src/api/overview.html"
options.stylesheetFile = file("$rootDir/src/api/stylesheet.css")
options.links(rootProject.ext.javadocLinks )
options.tags = [ "apiNote:a:API Note:", "implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:" ]
maxMemory = "1024m"
destinationDir = new File(project.buildDir, "docs/javadoc")
source project.sourceSets.main.allJava
doFirst {
classpath = files(project.sourceSets.main.compileClasspath)
}
}
task loops(type: Test) {
exclude '**/*'
include '**/*Loop.*'
}
task testNG(type: Test) {
exclude '**/*'
include '**/*Verification.*'
useTestNG()
}
sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
if (!JavaVersion.current().isJava9Compatible()) {
test {
jvmArgs = ["-Xbootclasspath/p:" + configurations.jsr166backport.asPath]
}
}
jar {
manifest {
attributes 'Implementation-Title': 'reactor-core',
'Implementation-Version': version
instruction 'Import-Package', bundleImportPackages.join(',')
}
}
artifacts {
archives sourcesJar
archives javadocJar
archives docsZip
}
jacocoTestReport.dependsOn testNG
check.dependsOn jacocoTestReport
}
project('reactor-test') {
description = 'Reactor Test support'
dependencies {
compile project(":reactor-core")
testCompile 'junit:junit:4.12'
testCompile "org.hamcrest:hamcrest-library:1.3",
"org.assertj:assertj-core:$assertJVersion",
"org.mockito:mockito-core:$mockitoVersion"
}
javadoc {
dependsOn jar
group = "Reactor Test Javadoc"
description = "Generates aggregated Javadoc API documentation."
title = "Reactor Test $version"
options.addStringOption('charSet', 'UTF-8')
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = "$project.name"
options.stylesheetFile = file("$rootDir/src/api/stylesheet.css")
options.links(rootProject.ext.javadocLinks
.plus("http://projectreactor.io/docs/core/release/api/") as String[])
options.tags = [ "apiNote:a:API Note:", "implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:" ]
maxMemory = "1024m"
destinationDir = new File(project.buildDir, "docs/javadoc")
source project.sourceSets.main.allJava
doFirst {
classpath = files(project.sourceSets.main.compileClasspath)
}
}
}
assemble.dependsOn docsZip