@@ -13,15 +13,14 @@ buildscript {
13
13
ext. jacocoVersion = " 0.8.4"
14
14
ext. animalSnifferVersion = " 1.5.2"
15
15
ext. licenseVersion = " 0.15.0"
16
- ext. bintrayVersion = " 1.8.5"
17
16
ext. jfrogExtractorVersion = " 4.20.0"
18
17
ext. bndVersion = " 5.2.0"
19
18
ext. checkstyleVersion = " 8.26"
19
+ ext. vanniktechPublishPlugin = " 0.13.0"
20
20
21
21
// --------------------------------------
22
22
23
23
repositories {
24
- jcenter()
25
24
mavenCentral()
26
25
maven {
27
26
url " https://plugins.gradle.org/m2/"
@@ -31,28 +30,27 @@ buildscript {
31
30
classpath " ru.vyarus:gradle-animalsniffer-plugin:$animalSnifferVersion "
32
31
classpath " gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseVersion "
33
32
classpath " me.champeau.gradle:jmh-gradle-plugin:$jmhGradleVersion "
34
- classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayVersion "
35
33
classpath " org.jfrog.buildinfo:build-info-extractor-gradle:$jfrogExtractorVersion "
36
34
classpath " biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion "
35
+ classpath " com.vanniktech:gradle-maven-publish-plugin:$vanniktechPublishPlugin "
37
36
}
38
37
}
39
38
40
39
group = " io.reactivex.rxjava3"
41
40
ext. githubProjectName = " rxjava"
42
41
43
- version = project. properties[" release.version" ]
44
-
45
42
def releaseTag = System . getenv(" BUILD_TAG" );
46
43
if (releaseTag != null && ! releaseTag. isEmpty()) {
47
44
if (releaseTag. startsWith(" v" )) {
48
45
releaseTag = releaseTag. substring(1 );
49
46
}
50
- version = releaseTag;
51
- project. properties. put(" release.version" , releaseTag);
47
+ project. setProperty(" VERSION_NAME" , releaseTag);
52
48
53
49
println (" Releasing with version " + version);
54
50
}
55
51
52
+ version = project. properties[" VERSION_NAME" ]
53
+
56
54
description = " RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM."
57
55
58
56
apply plugin : " java-library"
@@ -62,7 +60,6 @@ apply plugin: "ru.vyarus.animalsniffer"
62
60
apply plugin : " maven"
63
61
apply plugin : " me.champeau.gradle.jmh"
64
62
apply plugin : " com.github.hierynomus.license"
65
- apply plugin : " com.jfrog.bintray"
66
63
apply plugin : " com.jfrog.artifactory"
67
64
apply plugin : " eclipse"
68
65
@@ -116,21 +113,7 @@ animalsniffer {
116
113
annotation = " io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer"
117
114
}
118
115
119
- task sourcesJar (type : Jar , dependsOn : classes) {
120
- classifier = " sources"
121
- from sourceSets. main. allSource
122
- }
123
-
124
- task javadocJar (type : Jar , dependsOn : javadoc) {
125
- classifier = " javadoc"
126
- from javadoc. destinationDir
127
- }
128
-
129
- artifacts {
130
- archives jar
131
- archives sourcesJar
132
- archives javadocJar
133
- }
116
+ apply plugin : ' maven'
134
117
135
118
apply plugin : ' biz.aQute.bnd.builder'
136
119
@@ -154,61 +137,6 @@ license {
154
137
excludes([" **/*.md" , " **/*.txt" ])
155
138
}
156
139
157
- apply plugin : " maven-publish"
158
-
159
- install {
160
- repositories. mavenInstaller. pom. project {
161
- name " RxJava"
162
- description " Reactive Extensions for Java"
163
- url " https://github.com/ReactiveX/RxJava"
164
- licenses {
165
- license {
166
- name " The Apache Software License, Version 2.0"
167
- url " http://www.apache.org/licenses/LICENSE-2.0.txt"
168
- distribution " repo"
169
- }
170
- }
171
- developers {
172
- developer {
173
- id " akarnokd"
174
- name " David Karnok"
175
-
176
- }
177
- }
178
- scm {
179
- connection
" scm:git:[email protected] :ReactiveX/RxJava.git"
180
- url
" scm:git:[email protected] :ReactiveX/RxJava.git"
181
- developerConnection
" scm:git:[email protected] :ReactiveX/RxJava.git"
182
- }
183
- issueManagement {
184
- system " github"
185
- url " https://github.com/ReactiveX/RxJava/issues"
186
- }
187
- }
188
- }
189
-
190
- publishing {
191
- publications {
192
- mavenJava(MavenPublication ) {
193
- from components. java
194
- artifact (sourcesJar) {
195
- classifier = " sources"
196
- }
197
- }
198
- }
199
- }
200
-
201
- // Reactive-Streams as compile dependency
202
- publishing. publications. all {
203
- pom. withXml {
204
- asNode(). dependencies. " *" . findAll() {
205
- it. scope. text() == " runtime" && project. configurations. compile. allDependencies. find { dep ->
206
- dep. name == it. artifactId. text()
207
- }
208
- }. each { it. scope* . value = " compile" }
209
- }
210
- }
211
-
212
140
jmh {
213
141
jmhVersion = jmhLibVersion
214
142
humanOutputFile = null
@@ -312,12 +240,28 @@ checkstyle {
312
240
toolVersion = checkstyleVersion
313
241
}
314
242
243
+ apply from : file(" gradle/javadoc_cleanup.gradle" )
244
+
245
+ def fixPom () {
246
+ // Reactive-Streams as compile dependency
247
+ publishing. publications. all {
248
+ pom. withXml {
249
+ asNode(). dependencies. " *" . findAll() {
250
+ it. scope. text() == " runtime" && project. configurations. compile. allDependencies. find { dep ->
251
+ dep. name == it. artifactId. text()
252
+ }
253
+ }. each { it. scope* . value = " compile" }
254
+ }
255
+ }
256
+ }
257
+
315
258
if (rootProject. hasProperty(" releaseMode" )) {
316
259
317
260
if (" branch" . equals(rootProject. releaseMode)) {
318
261
// From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94
319
262
320
263
println (" ReleaseMode: " + rootProject. releaseMode);
264
+
321
265
artifactory {
322
266
contextUrl = " https://oss.jfrog.org"
323
267
@@ -332,48 +276,23 @@ if (rootProject.hasProperty("releaseMode")) {
332
276
defaults {
333
277
publishConfigs(" archives" )
334
278
}
279
+
280
+ fixPom()
335
281
}
336
282
}
337
283
338
284
build. finalizedBy(artifactoryPublish)
339
285
}
340
286
341
- if (" full" . equals(rootProject. releaseMode)) {
342
- // based on https://github.com/bintray/gradle-bintray-plugin
343
- def rver = version;
344
-
345
- println (" ReleaseMode: " + rootProject. releaseMode + " version " + rver);
346
-
347
- bintray {
348
- user = rootProject. bintrayUser
349
- key = rootProject. bintrayKey
350
- configurations = [" archives" ]
351
- publish = true
352
- override = true // Allows re-running the GHA upon release hangs
353
- pkg {
354
- repo = " RxJava"
355
- name = " RxJava"
356
- userOrg = " reactivex"
357
- labels = [" rxjava" , " reactivex" ]
358
- licenses = [" Apache-2.0" ]
359
- vcsUrl = " https://github.com/ReactiveX/RxJava.git"
360
- version {
361
- name = rver
362
- gpg {
363
- sign = true
364
- }
365
- mavenCentralSync {
366
- sync = true
367
- user = rootProject. sonatypeUsername
368
- password = rootProject. sonatypePassword
369
- close = " 1"
370
- }
371
- }
372
- }
287
+ if (" full" . equals(rootProject. releaseMode)) {
288
+ apply plugin : " com.vanniktech.maven.publish"
289
+
290
+ fixPom()
291
+
292
+ signing {
293
+ if (project. hasProperty(' SIGNING_PRIVATE_KEY' ) && project. hasProperty(' SIGNING_PASSWORD' )) {
294
+ useInMemoryPgpKeys(project. getProperty(' SIGNING_PRIVATE_KEY' ), project. getProperty(' SIGNING_PASSWORD' ))
373
295
}
374
-
375
- build. finalizedBy(bintrayUpload)
376
- }
296
+ }
297
+ }
377
298
}
378
-
379
- apply from : file(" gradle/javadoc_cleanup.gradle" )
0 commit comments