forked from reactor/reactor-rabbitmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
265 lines (223 loc) · 7.18 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
/*
* 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.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11',
'org.springframework.build.gradle:propdeps-plugin:0.0.7',
'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE',
'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
}
}
plugins {
id 'org.asciidoctor.convert' version '1.5.3'
}
ext {
gradleVersion = '3.1'
gradleScriptDir = "${rootProject.projectDir}/gradle"
reactorCoreVersion = "3.1.1.RELEASE"
// Logging
slf4jVersion = '1.7.25'
logbackVersion = '1.2.3'
// Libraries
rabbitMqJavaClientVersion = '5.0.0'
// Testing
mockitoVersion = '1.10.19'
awaitilityVersion = '3.0.0'
junitPlatformVersion = '1.0.0'
junitJupiterVersion = '5.0.0'
javadocLinks = ["http://docs.oracle.com/javase/7/docs/api/",
"http://docs.oracle.com/javaee/6/api/",
"http://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/",
"http://projectreactor.io/docs/core/release/api/",
"http://www.rabbitmq.com/releases/rabbitmq-java-client/current-javadoc/",] as String[]
}
apply from: "$gradleScriptDir/setup.gradle"
apply from: "$gradleScriptDir/doc.gradle"
configurations.all {
// check for snapshot updates every time
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
allprojects {
apply plugin: 'jacoco'
jacoco {
toolVersion = '0.7.7.201606060606'
}
}
configure(allprojects) { project ->
group = 'io.projectreactor.rabbitmq'
repositories {
maven { url 'http://repo.spring.io/libs-release' }
maven { url 'http://repo.spring.io/libs-snapshot' }
mavenCentral()
jcenter()
}
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'propdeps'
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
sourceCompatibility = targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.compilerArgs = ["-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:deprecation",
"-Xlint:unchecked",
"-Xlint:-serial", // intentionally disabled
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:-rawtypes" // TODO enable and fix warnings
]
junitPlatform {
filters {
includeClassNamePattern '.*Tests'
}
// store test results where Bamboo expects them or the build will fail
reportsDir file('build/test-results/test')
}
// to generate HTML test reports
// from https://stackoverflow.com/questions/39444908/how-to-create-an-html-report-for-junit-5-tests/39455463#39455463
configurations {
junitXmlToHtml
}
task generateHtmlTestReports << {
def reportsDir = new File(buildDir, 'reports/tests/test')
reportsDir.mkdirs()
ant.taskdef(
name: 'junitReport',
classname: 'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator',
classpath: configurations.junitXmlToHtml.asPath
)
ant.junitReport(todir: "$buildDir/test-results/test", tofile: "aggregated-test-results.xml") {
fileset(dir: "$buildDir/test-results/test")
report(format: 'frames', todir: reportsDir)
}
}
afterEvaluate {
def junitPlatformTestTask = tasks.getByName('junitPlatformTest')
generateHtmlTestReports.dependsOn(junitPlatformTestTask)
test.dependsOn(generateHtmlTestReports)
}
// end of HTML test reports
jacocoTestReport {
dependsOn test
sourceSets sourceSets.main
reports {
html.enabled = true
xml.enabled = true
}
}
jacocoTestReport.dependsOn test
dependencies {
compile "io.projectreactor:reactor-core:$reactorCoreVersion"
compile "com.rabbitmq:amqp-client:$rabbitMqJavaClientVersion"
// Testing
// JUnit Jupiter API and TestEngine implementation
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
// Only needed to run tests in an (IntelliJ) IDE(A) that bundles an older version
testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}")
testCompile "io.projectreactor:reactor-test:$reactorCoreVersion"
testCompile "org.awaitility:awaitility:$awaitilityVersion",
"org.mockito:mockito-core:$mockitoVersion"
testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion"
testRuntime "org.slf4j:slf4j-api:$slf4jVersion"
testRuntime "ch.qos.logback:logback-classic:$logbackVersion"
// to generate HTML test reports
junitXmlToHtml 'org.apache.ant:ant-junit:1.9.7'
}
project.tasks.withType(Test).all {
systemProperty("java.awt.headless", "true")
systemProperty("reactor.trace.cancel", "true")
systemProperty("reactor.trace.nocapacity", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
scanForTestClasses = false
include '**/*Tests.*'
include '**/*Spec.*'
exclude '**/*Abstract*.*'
}
// force test runs even when there are no test changes
test.outputs.upToDateWhen { false }
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
repositories {
maven { url 'http://repo.spring.io/libs-snapshot' }
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:$platformVersion"
}
}
}
}
}
configure(rootProject) {
archivesBaseName = 'reactor-rabbitmq'
description = 'Reactor RabbitMQ: A reactive API for RabbitMQ'
jar {
manifest {
attributes("Automatic-Module-Name": "reactor.rabbitmq",
"Implementation-Version": version)
}
}
artifacts {
archives sourcesJar
archives javadocJar
archives docsZip
}
}
project(':reactor-rabbitmq-samples') {
archivesBaseName = 'reactor-rabbitmq-samples'
description = 'Samples for Reactor RabbitMQ'
dependencies {
compile rootProject
runtime "ch.qos.logback:logback-classic:$logbackVersion"
testCompile rootProject.sourceSets.test.output
}
task sender(type:JavaExec) {
main = 'reactor.rabbitmq.samples.SampleSender'
classpath = sourceSets.main.runtimeClasspath
}
task receiver(type:JavaExec) {
main = 'reactor.rabbitmq.samples.SampleReceiver'
classpath = sourceSets.main.runtimeClasspath
}
task classpath << {
println sourceSets.main.runtimeClasspath.asPath
}
test {
jacoco {
enabled = false
}
}
artifacts {
archives sourcesJar
archives javadocJar
}
}