-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
254 lines (206 loc) · 6.26 KB
/
build.gradle
File metadata and controls
254 lines (206 loc) · 6.26 KB
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
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.2.0"
// classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1"
classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.5"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.2"
}
}
apply plugin: "java-library"
apply plugin: "maven"
apply plugin: "eclipse"
subprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
apply plugin: "java-library"
apply plugin: "maven"
apply plugin: "eclipse"
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
if(project.name.startsWith('io.reactivex.core')){
dependencies{
compile project (':io.reactivex.common')
}
}
def reactiveStreamsVersion = "1.0.2"
dependencies {
api "org.reactivestreams:reactive-streams:$reactiveStreamsVersion"
api "org.reactivestreams:reactive-streams-tck:$reactiveStreamsVersion"
api "org.reactivestreams:reactive-streams-examples:$reactiveStreamsVersion"
}
sourceSets {
main.java.srcDirs = ['src']
}
compileJava {
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath
]
classpath = files()
}
}
}
dependencies{
compile project (':io.reactivex.core')
}
//apply plugin: "checkstyle"
apply plugin: "jacoco"
apply plugin: "ru.vyarus.animalsniffer"
apply plugin: "maven"
apply plugin: "osgi"
apply plugin: "me.champeau.gradle.jmh"
//apply plugin: "com.github.hierynomus.license"
apply plugin: "com.jfrog.bintray"
apply plugin: "com.jfrog.artifactory"
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
group = "io.reactivex.rxjava2"
ext.githubProjectName = "rxjava"
version = project.properties["release.version"]
jar.enabled = false
// Dependency versions
// ---------------------------------------
def junitVersion = "4.12"
def reactiveStreamsVersion = "1.0.2"
def mockitoVersion = "2.1.0"
def jmhLibVersion = "1.20"
def testNgVersion = "6.11"
def guavaVersion = "24.0-jre"
def jacocoVersion = "0.8.0"
// --------------------------------------
dependencies {
signature "org.codehaus.mojo.signature:java16:1.1@signature"
testCompile 'junit:junit:4.12'
testCompile project(':io.reactivex.common')
testCompile project(':io.reactivex.core')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.1'
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.reactivestreams:reactive-streams-tck:$reactiveStreamsVersion"
testImplementation "org.testng:testng:$testNgVersion"
testImplementation "com.google.guava:guava:$guavaVersion"
}
animalsniffer {
annotation = "io.reactivex.internal.util.SuppressAnimalSniffer"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
/*
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
*/
sourceSets {
test.java.srcDirs = ['io.reactivex.tests/src']
}
compileTestJava {
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'org.junit.jupiter.api',
'--add-modules','io.reactivex.common',
'--add-modules','io.reactivex.core',
]
classpath = files()
}
}
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Test.class"
}
test {
exclude 'io/reactivex/tests/tck/**'
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 = jacocoVersion // See http://www.eclemma.org/jacoco/.
}
task GCandMem(dependsOn: "check") doLast {
print("Memory usage before: ")
println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
System.gc()
Thread.sleep(200)
print("Memory usage: ")
println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
}
task GCandMem2(dependsOn: "test") doLast {
print("Memory usage before: ")
println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
System.gc()
Thread.sleep(200)
print("Memory usage: ")
println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
}
testng.dependsOn GCandMem2
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ["io/reactivex/tests/tck/**"])
})
}
}
jacocoTestReport.dependsOn GCandMem
build.dependsOn jacocoTestReport
/*
checkstyle {
configFile file("checkstyle.xml")
ignoreFailures = true
toolVersion ="8.14"
}
*/
//apply from: file("gradle/javadoc_cleanup.gradle")