@@ -13,15 +13,14 @@ buildscript {
1313 ext. jacocoVersion = " 0.8.4"
1414 ext. animalSnifferVersion = " 1.5.2"
1515 ext. licenseVersion = " 0.15.0"
16- ext. bintrayVersion = " 1.8.5"
1716 ext. jfrogExtractorVersion = " 4.20.0"
1817 ext. bndVersion = " 5.2.0"
1918 ext. checkstyleVersion = " 8.26"
19+ ext. vanniktechPublishPlugin = " 0.13.0"
2020
2121 // --------------------------------------
2222
2323 repositories {
24- jcenter()
2524 mavenCentral()
2625 maven {
2726 url " https://plugins.gradle.org/m2/"
@@ -31,28 +30,27 @@ buildscript {
3130 classpath " ru.vyarus:gradle-animalsniffer-plugin:$animalSnifferVersion "
3231 classpath " gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseVersion "
3332 classpath " me.champeau.gradle:jmh-gradle-plugin:$jmhGradleVersion "
34- classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayVersion "
3533 classpath " org.jfrog.buildinfo:build-info-extractor-gradle:$jfrogExtractorVersion "
3634 classpath " biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion "
35+ classpath " com.vanniktech:gradle-maven-publish-plugin:$vanniktechPublishPlugin "
3736 }
3837}
3938
4039group = " io.reactivex.rxjava3"
4140ext. githubProjectName = " rxjava"
4241
43- version = project. properties[" release.version" ]
44-
4542def releaseTag = System . getenv(" BUILD_TAG" );
4643if (releaseTag != null && ! releaseTag. isEmpty()) {
4744 if (releaseTag. startsWith(" v" )) {
4845 releaseTag = releaseTag. substring(1 );
4946 }
50- version = releaseTag;
51- project. properties. put(" release.version" , releaseTag);
47+ project. setProperty(" VERSION_NAME" , releaseTag);
5248
5349 println (" Releasing with version " + version);
5450}
5551
52+ version = project. properties[" VERSION_NAME" ]
53+
5654description = " RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM."
5755
5856apply plugin : " java-library"
@@ -62,7 +60,6 @@ apply plugin: "ru.vyarus.animalsniffer"
6260apply plugin : " maven"
6361apply plugin : " me.champeau.gradle.jmh"
6462apply plugin : " com.github.hierynomus.license"
65- apply plugin : " com.jfrog.bintray"
6663apply plugin : " com.jfrog.artifactory"
6764apply plugin : " eclipse"
6865
@@ -116,21 +113,7 @@ animalsniffer {
116113 annotation = " io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer"
117114}
118115
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'
134117
135118apply plugin : ' biz.aQute.bnd.builder'
136119
@@ -154,61 +137,6 @@ license {
154137 excludes([" **/*.md" , " **/*.txt" ])
155138}
156139
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-
212140jmh {
213141 jmhVersion = jmhLibVersion
214142 humanOutputFile = null
@@ -312,12 +240,28 @@ checkstyle {
312240 toolVersion = checkstyleVersion
313241}
314242
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+
315258if (rootProject. hasProperty(" releaseMode" )) {
316259
317260 if (" branch" . equals(rootProject. releaseMode)) {
318261 // From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94
319262
320263 println (" ReleaseMode: " + rootProject. releaseMode);
264+
321265 artifactory {
322266 contextUrl = " https://oss.jfrog.org"
323267
@@ -332,48 +276,23 @@ if (rootProject.hasProperty("releaseMode")) {
332276 defaults {
333277 publishConfigs(" archives" )
334278 }
279+
280+ fixPom()
335281 }
336282 }
337283
338284 build. finalizedBy(artifactoryPublish)
339285 }
340286
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' ))
373295 }
374-
375- build. finalizedBy(bintrayUpload)
376- }
296+ }
297+ }
377298}
378-
379- apply from : file(" gradle/javadoc_cleanup.gradle" )
0 commit comments