forked from ReactiveX/RxJava
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
200 lines (158 loc) · 5 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
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.netflix.nebula:gradle-rxjava-project-plugin:4.0.0'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.1.0'
}
}
group = 'io.reactivex.rxjava2'
description = 'RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.'
apply plugin: 'java'
// apply plugin: 'pmd' // disabled because runs out of memory on Travis
// apply plugin: 'findbugs' // disabled because runs out of memory on Travis
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'nebula.rxjava-project'
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
compile 'org.reactivestreams:reactive-streams:1.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.1.0'
perfCompile 'org.openjdk.jmh:jmh-core:1.16'
perfCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.16'
testCompile 'org.reactivestreams:reactive-streams-tck:1.0.0'
testCompile group: 'org.testng', name: 'testng', version: '6.9.10'
}
javadoc {
exclude "**/internal/**"
exclude "**/test/**"
exclude "**/perf/**"
options {
windowTitle = "RxJava Javadoc ${project.version}"
}
// Clear the following options to make the docs consistent with the old format
options.addStringOption('top').value = ''
options.addStringOption('doctitle').value = ''
options.addStringOption('header').value = ''
if (JavaVersion.current().isJava7()) {
// "./gradle/stylesheet.css" only supports Java 7
options.addStringOption('stylesheetfile', rootProject.file('./gradle/stylesheet.css').toString())
}
}
animalsniffer {
annotation = 'io.reactivex.internal.util.SuppressAnimalSniffer'
}
// support for snapshot/final releases with the various branches RxJava uses
nebulaRelease {
addReleaseBranchPattern(/\d+\.\d+\.\d+/)
addReleaseBranchPattern('HEAD')
}
if (project.hasProperty('release.useLastTag')) {
tasks.prepare.enabled = false
}
test {
testLogging {
// showing skipped occasionally should prevent CI timeout due to lack of standard output
events=['skipped', 'failed'] // "started", "passed"
// showStandardStreams = true
exceptionFormat="full"
debug.events = ["skipped", "failed"]
debug.exceptionFormat="full"
info.events = ["failed", "skipped"]
info.exceptionFormat="full"
warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
maxHeapSize = "1200m"
if (System.getenv('CI') == null) {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}
task testng(type: Test) {
useTestNG()
testLogging {
events=['skipped', 'failed']
exceptionFormat="full"
debug.events = ["skipped", "failed"]
debug.exceptionFormat="full"
info.events = ["failed", "skipped"]
info.exceptionFormat="full"
warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
}
check.dependsOn testng
jacoco {
toolVersion = '0.7.7.201606060606' // See http://www.eclemma.org/jacoco/.
}
task GCandMem(dependsOn: 'check') << {
System.gc()
Thread.sleep(200)
print("Memory usage: ")
println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['io/reactivex/tck/**'])
})
}
}
jacocoTestReport.dependsOn GCandMem
build.dependsOn jacocoTestReport
// pmd {
// toolVersion = '5.4.2'
// ignoreFailures = true
// sourceSets = [sourceSets.main]
// ruleSets = []
// ruleSetFiles = files('pmd.xml')
// }
// pmdMain {
// reports {
// html.enabled = true
// xml.enabled = true
// }
// }
// build.dependsOn pmdMain
// task pmdPrint(dependsOn: 'pmdMain') << {
// File file = new File('build/reports/pmd/main.xml')
// if (file.exists()) {
// println("Listing first 100 PMD violations")
// file.eachLine { line, count ->
// if (count <= 100) {
// println(line)
// }
// }
// } else {
// println("PMD file not found.")
// }
// }
// build.dependsOn pmdPrint
checkstyle {
configFile file('checkstyle.xml')
ignoreFailures = true
toolVersion ="6.19"
}
/*
findbugs {
ignoreFailures true
toolVersion = '3.0.1'
effort = 'max'
reportLevel = 'low'
sourceSets = [sourceSets.main]
}
findbugsMain {
reports {
html.enabled = false // Findbugs can only have on report enabled
xml.enabled = true
}
}
*/