1
- buildscript {
1
+ plugins {
2
+ id(" java-library" )
3
+ id(" checkstyle" )
4
+ id(" eclipse" )
5
+ id(" jacoco" )
6
+ id(" maven-publish" )
7
+ id(" ru.vyarus.animalsniffer" ) version " 1.5.3"
8
+ id(" me.champeau.gradle.jmh" ) version " 0.5.3"
9
+ id(" com.github.hierynomus.license" ) version " 0.15.0"
10
+ id(" com.jfrog.artifactory" ) version " 4.21.0"
11
+ id(" biz.aQute.bnd.builder" ) version " 5.3.0"
12
+ id(" com.vanniktech.maven.publish" ) version " 0.14.2"
13
+ }
2
14
3
- // Dependency versions
4
- // ---------------------------------------
5
- ext {
15
+ ext {
6
16
reactiveStreamsVersion = " 1.0.3"
7
17
junitVersion = " 4.13.2"
8
18
testNgVersion = " 7.3.0"
9
19
mockitoVersion = " 3.8.0"
10
20
jmhLibVersion = " 1.21"
11
- jmhGradleVersion = " 0.5.3"
12
21
guavaVersion = " 30.1.1-jre"
13
22
jacocoVersion = " 0.8.4"
14
- animalSnifferVersion = " 1.5.3"
15
- licenseVersion = " 0.15.0"
16
- jfrogExtractorVersion = " 4.21.0"
17
- bndVersion = " 5.3.0"
18
23
checkstyleVersion = " 8.41"
19
- vanniktechPublishPlugin = " 0.14.2"
20
- }
21
-
22
- // --------------------------------------
23
-
24
- repositories {
25
- mavenCentral()
26
- gradlePluginPortal()
27
- }
28
- dependencies {
29
- classpath " ru.vyarus:gradle-animalsniffer-plugin:$animalSnifferVersion "
30
- classpath " gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseVersion "
31
- classpath " me.champeau.gradle:jmh-gradle-plugin:$jmhGradleVersion "
32
- classpath " org.jfrog.buildinfo:build-info-extractor-gradle:$jfrogExtractorVersion "
33
- classpath " biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion "
34
- classpath " com.vanniktech:gradle-maven-publish-plugin:$vanniktechPublishPlugin "
35
- }
36
24
}
37
25
38
- group = " io.reactivex.rxjava3"
39
- ext. githubProjectName = " rxjava"
40
-
41
- def releaseTag = System . getenv(" BUILD_TAG" );
26
+ def releaseTag = System . getenv(" BUILD_TAG" )
42
27
if (releaseTag != null && ! releaseTag. isEmpty()) {
43
28
if (releaseTag. startsWith(" v" )) {
44
- releaseTag = releaseTag. substring(1 );
29
+ releaseTag = releaseTag. substring(1 )
45
30
}
46
- project. setProperty(" VERSION_NAME" , releaseTag);
31
+ project. setProperty(" VERSION_NAME" , releaseTag)
47
32
48
- println (" Releasing with version " + version);
33
+ logger . info (" Releasing with version: {} " , version)
49
34
}
50
35
36
+ group = " io.reactivex.rxjava3"
51
37
version = project. properties[" VERSION_NAME" ]
52
-
53
38
description = " RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM."
54
39
55
- apply plugin : " java-library"
56
- apply plugin : " checkstyle"
57
- apply plugin : " jacoco"
58
- apply plugin : " ru.vyarus.animalsniffer"
59
- apply plugin : " maven"
60
- apply plugin : " me.champeau.gradle.jmh"
61
- apply plugin : " com.github.hierynomus.license"
62
- apply plugin : " com.jfrog.artifactory"
63
- apply plugin : " eclipse"
64
-
65
40
sourceCompatibility = JavaVersion . VERSION_1_8
66
41
targetCompatibility = JavaVersion . VERSION_1_8
67
42
68
43
repositories {
69
- mavenCentral()
44
+ mavenCentral()
70
45
}
71
46
72
47
dependencies {
@@ -84,7 +59,7 @@ dependencies {
84
59
}
85
60
86
61
tasks. withType(JavaCompile ) {
87
- options. compilerArgs << " -parameters" ;
62
+ options. compilerArgs << " -parameters"
88
63
}
89
64
90
65
javadoc {
@@ -100,7 +75,7 @@ javadoc {
100
75
options. addStringOption(" top" ). value = " "
101
76
options. addStringOption(" doctitle" ). value = " "
102
77
options. addStringOption(" header" ). value = " "
103
- options. stylesheetFile = new File (projectDir, " gradle/stylesheet.css" );
78
+ options. stylesheetFile = rootProject . file( " gradle/stylesheet.css" )
104
79
105
80
options. links(
106
81
" https://docs.oracle.com/javase/8/docs/api/" ,
@@ -112,19 +87,16 @@ animalsniffer {
112
87
annotation = " io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer"
113
88
}
114
89
115
- apply plugin : ' maven'
116
-
117
- apply plugin : ' biz.aQute.bnd.builder'
118
-
119
90
jar {
120
- bnd (' Bundle-Name' : ' rxjava' ,
121
- ' Bundle-Vendor' : ' RxJava Contributors' ,
122
- ' Bundle-Description' : ' Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.' ,
123
- ' Import-Package' : ' !org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*' ,
124
- ' Bundle-DocURL' : ' https://github.com/ReactiveX/RxJava' ,
125
- ' Eclipse-ExtensibleAPI' : ' true' ,
126
- ' Automatic-Module-Name' : ' io.reactivex.rxjava3' ,
127
- ' Export-Package' : ' !io.reactivex.rxjava3.internal.*, io.reactivex.rxjava3.*'
91
+ bnd (
92
+ " Bundle-Name" : " rxjava" ,
93
+ " Bundle-Vendor" : " RxJava Contributors" ,
94
+ " Bundle-Description" : " Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM." ,
95
+ " Import-Package" : " !org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*" ,
96
+ " Bundle-DocURL" : " https://github.com/ReactiveX/RxJava" ,
97
+ " Eclipse-ExtensibleAPI" : " true" ,
98
+ " Automatic-Module-Name" : " io.reactivex.rxjava3" ,
99
+ " Export-Package" : " !io.reactivex.rxjava3.internal.*, io.reactivex.rxjava3.*"
128
100
)
129
101
}
130
102
@@ -144,14 +116,13 @@ jmh {
144
116
jvmArgsAppend = [" -Djmh.separateClasspathJAR=true" ]
145
117
146
118
if (project. hasProperty(" jmh" )) {
147
- include = " .*" + project. jmh + " .*"
148
- println (" JMH: " + include);
119
+ include = [ " .*" + project. jmh + " .*" ]
120
+ logger . info (" JMH: {} " , include)
149
121
}
150
-
151
122
}
152
123
153
124
plugins. withType(EclipsePlugin ) {
154
- project. eclipse. classpath. plusConfigurations + = [ configurations. jmh ]
125
+ project. eclipse. classpath. plusConfigurations + = [configurations. jmh]
155
126
}
156
127
157
128
test {
@@ -199,25 +170,21 @@ task testng(type: Test) {
199
170
check. dependsOn testng
200
171
201
172
jacoco {
202
- toolVersion = jacocoVersion // See http://www.eclemma.org/jacoco/.
173
+ toolVersion = jacocoVersion
203
174
}
204
175
205
176
task GCandMem (dependsOn : " check" ) doLast {
206
- print (" Memory usage before: " )
207
- println (java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
177
+ logger. lifecycle(" Memory usage before: {}" , java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
208
178
System . gc()
209
179
Thread . sleep(200 )
210
- print (" Memory usage: " )
211
- println (java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
180
+ logger. lifecycle(" Memory usage: {}" , java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
212
181
}
213
182
214
183
task GCandMem2 (dependsOn : " test" ) doLast {
215
- print (" Memory usage before: " )
216
- println (java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
184
+ logger. lifecycle(" Memory usage before: {}" , java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
217
185
System . gc()
218
186
Thread . sleep(200 )
219
- print (" Memory usage: " )
220
- println (java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
187
+ logger. lifecycle(" Memory usage: {}" , java.lang.management.ManagementFactory . getMemoryMXBean(). getHeapMemoryUsage(). getUsed() / 1024.0 / 1024.0 )
221
188
}
222
189
223
190
testng. dependsOn GCandMem2
@@ -258,12 +225,10 @@ def fixPom() {
258
225
}
259
226
260
227
if (rootProject. hasProperty(" releaseMode" )) {
228
+ logger. lifecycle(" ReleaseMode: {}" , rootProject. releaseMode)
261
229
262
230
if (" branch" . equals(rootProject. releaseMode)) {
263
231
// From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94
264
-
265
- println (" ReleaseMode: " + rootProject. releaseMode);
266
-
267
232
artifactory {
268
233
contextUrl = " https://oss.jfrog.org"
269
234
@@ -287,13 +252,11 @@ if (rootProject.hasProperty("releaseMode")) {
287
252
}
288
253
289
254
if (" full" . equals(rootProject. releaseMode)) {
290
- apply plugin : " com.vanniktech.maven.publish"
291
-
292
255
fixPom()
293
256
294
257
signing {
295
- if (project. hasProperty(' SIGNING_PRIVATE_KEY' ) && project. hasProperty(' SIGNING_PASSWORD' )) {
296
- useInMemoryPgpKeys(project. getProperty(' SIGNING_PRIVATE_KEY' ), project. getProperty(' SIGNING_PASSWORD' ))
258
+ if (project. hasProperty(" SIGNING_PRIVATE_KEY" ) && project. hasProperty(" SIGNING_PASSWORD" )) {
259
+ useInMemoryPgpKeys(project. getProperty(" SIGNING_PRIVATE_KEY" ), project. getProperty(" SIGNING_PASSWORD" ))
297
260
}
298
261
}
299
262
mavenPublish {
0 commit comments