This repository has been archived by the owner on Jun 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.gradle
254 lines (193 loc) · 6.27 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
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.1.0'
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1'
classpath "me.champeau.gradle:jmh-gradle-plugin:0.2.0"
classpath 'com.palantir:jacoco-coverage:0.4.0'
}
}
group = 'com.github.akarnokd'
description = 'Preview for version 3 of RxJava, the modern ReactiveX style library for composing (a)synchronous sequences of data and events.'
ext.githubProjectName = 'RxJava3-preview'
repositories {
mavenCentral()
}
allprojects {
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
}
subprojects {
repositories {
mavenCentral()
jcenter()
}
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: "me.champeau.gradle.jmh"
apply plugin: "com.github.hierynomus.license"
group = 'com.github.akarnokd'
ext.githubProjectName = 'RxJava3-preview'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
apply from: file("$rootDir/gradle/maven.gradle")
apply plugin: 'maven'
apply plugin: 'osgi'
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.1.0'
testCompile group: 'org.testng', name: 'testng', version: '6.10'
}
javadoc {
failOnError = false
exclude "**/internal/**"
exclude "**/test/**"
exclude "**/perf/**"
exclude "**/jmh/**"
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())
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
jar {
manifest {
name = 'reactive-streams-jvm-extensions-xp'
instruction 'Bundle-Vendor', 'akarnokd'
instruction 'Bundle-DocURL', 'https://github.com/akarnokd/reactive-streams-jvm-extensions-xp'
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
instruction 'Eclipse-ExtensibleAPI', 'true'
}
}
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact (sourcesJar) {
classifier = 'sources'
}
}
}
}
jmh {
jmhVersion = '1.17.4'
humanOutputFile = null
if (project.hasProperty('jmh')) {
include = ".*" + project.jmh + ".*"
} else {
include = ".*"
}
}
license {
header rootProject.file('HEADER')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}
plugins.withType(EclipsePlugin) {
project.eclipse.classpath.plusConfigurations += [ configurations.jmh ]
}
animalsniffer {
annotation = 'io.reactivex.common.internal.SuppressAnimalSniffer'
}
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
task GCandMem(dependsOn: 'check') << {
print("Memory usage before GC: ")
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)
}
checkstyle {
configFile rootProject.file('checkstyle.xml')
ignoreFailures = true
toolVersion ="6.19"
}
jacoco {
toolVersion = '0.7.9' // See http://www.eclemma.org/jacoco/.
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
build.dependsOn jacocoTestReport
check.dependsOn jacocoTestReport
publishing.publications.all {
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile'}
}
}
}
apply plugin: 'com.palantir.jacoco-full-report'
jacoco {
toolVersion = '0.7.9' // See http://www.eclemma.org/jacoco/.
}