-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.x: Release to Sonatype directly (#7181)
* 3.x: Release to Sonatype directly * Update build.gradle * Update gradle.properties * Turn RS into compile dependency in POM * Fix the POM of the snapshot/artifactory upload
- Loading branch information
Showing
4 changed files
with
66 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,14 @@ buildscript { | |
ext.jacocoVersion = "0.8.4" | ||
ext.animalSnifferVersion = "1.5.2" | ||
ext.licenseVersion = "0.15.0" | ||
ext.bintrayVersion = "1.8.5" | ||
ext.jfrogExtractorVersion = "4.20.0" | ||
ext.bndVersion = "5.2.0" | ||
ext.checkstyleVersion = "8.26" | ||
ext.vanniktechPublishPlugin = "0.13.0" | ||
|
||
// -------------------------------------- | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
|
@@ -31,28 +30,27 @@ buildscript { | |
classpath "ru.vyarus:gradle-animalsniffer-plugin:$animalSnifferVersion" | ||
classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseVersion" | ||
classpath "me.champeau.gradle:jmh-gradle-plugin:$jmhGradleVersion" | ||
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayVersion" | ||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$jfrogExtractorVersion" | ||
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion" | ||
classpath "com.vanniktech:gradle-maven-publish-plugin:$vanniktechPublishPlugin" | ||
} | ||
} | ||
|
||
group = "io.reactivex.rxjava3" | ||
ext.githubProjectName = "rxjava" | ||
|
||
version = project.properties["release.version"] | ||
|
||
def releaseTag = System.getenv("BUILD_TAG"); | ||
if (releaseTag != null && !releaseTag.isEmpty()) { | ||
if (releaseTag.startsWith("v")) { | ||
releaseTag = releaseTag.substring(1); | ||
} | ||
version = releaseTag; | ||
project.properties.put("release.version", releaseTag); | ||
project.setProperty("VERSION_NAME" , releaseTag); | ||
|
||
println("Releasing with version " + version); | ||
} | ||
|
||
version = project.properties["VERSION_NAME"] | ||
|
||
description = "RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM." | ||
|
||
apply plugin: "java-library" | ||
|
@@ -62,7 +60,6 @@ apply plugin: "ru.vyarus.animalsniffer" | |
apply plugin: "maven" | ||
apply plugin: "me.champeau.gradle.jmh" | ||
apply plugin: "com.github.hierynomus.license" | ||
apply plugin: "com.jfrog.bintray" | ||
apply plugin: "com.jfrog.artifactory" | ||
apply plugin: "eclipse" | ||
|
||
|
@@ -116,21 +113,7 @@ animalsniffer { | |
annotation = "io.reactivex.rxjava3.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 | ||
} | ||
|
||
artifacts { | ||
archives jar | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
apply plugin: 'maven' | ||
|
||
apply plugin: 'biz.aQute.bnd.builder' | ||
|
||
|
@@ -154,61 +137,6 @@ license { | |
excludes(["**/*.md", "**/*.txt"]) | ||
} | ||
|
||
apply plugin: "maven-publish" | ||
|
||
install { | ||
repositories.mavenInstaller.pom.project { | ||
name "RxJava" | ||
description "Reactive Extensions for Java" | ||
url "https://github.com/ReactiveX/RxJava" | ||
licenses { | ||
license { | ||
name "The Apache Software License, Version 2.0" | ||
url "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
distribution "repo" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id "akarnokd" | ||
name "David Karnok" | ||
email "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection "scm:git:[email protected]:ReactiveX/RxJava.git" | ||
url "scm:git:[email protected]:ReactiveX/RxJava.git" | ||
developerConnection "scm:git:[email protected]:ReactiveX/RxJava.git" | ||
} | ||
issueManagement { | ||
system "github" | ||
url "https://github.com/ReactiveX/RxJava/issues" | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
artifact (sourcesJar) { | ||
classifier = "sources" | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Reactive-Streams as compile dependency | ||
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"} | ||
} | ||
} | ||
|
||
jmh { | ||
jmhVersion = jmhLibVersion | ||
humanOutputFile = null | ||
|
@@ -312,12 +240,28 @@ checkstyle { | |
toolVersion = checkstyleVersion | ||
} | ||
|
||
apply from: file("gradle/javadoc_cleanup.gradle") | ||
|
||
def fixPom() { | ||
// Reactive-Streams as compile dependency | ||
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"} | ||
} | ||
} | ||
} | ||
|
||
if (rootProject.hasProperty("releaseMode")) { | ||
|
||
if ("branch".equals(rootProject.releaseMode)) { | ||
// From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94 | ||
|
||
println("ReleaseMode: " + rootProject.releaseMode); | ||
|
||
artifactory { | ||
contextUrl = "https://oss.jfrog.org" | ||
|
||
|
@@ -332,48 +276,23 @@ if (rootProject.hasProperty("releaseMode")) { | |
defaults { | ||
publishConfigs("archives") | ||
} | ||
|
||
fixPom() | ||
} | ||
} | ||
|
||
build.finalizedBy(artifactoryPublish) | ||
} | ||
|
||
if ("full".equals(rootProject.releaseMode)) { | ||
// based on https://github.com/bintray/gradle-bintray-plugin | ||
def rver = version; | ||
|
||
println("ReleaseMode: " + rootProject.releaseMode + " version " + rver); | ||
|
||
bintray { | ||
user = rootProject.bintrayUser | ||
key = rootProject.bintrayKey | ||
configurations = ["archives"] | ||
publish = true | ||
override = true // Allows re-running the GHA upon release hangs | ||
pkg { | ||
repo = "RxJava" | ||
name = "RxJava" | ||
userOrg = "reactivex" | ||
labels = ["rxjava", "reactivex"] | ||
licenses = ["Apache-2.0"] | ||
vcsUrl = "https://github.com/ReactiveX/RxJava.git" | ||
version { | ||
name = rver | ||
gpg { | ||
sign = true | ||
} | ||
mavenCentralSync { | ||
sync = true | ||
user = rootProject.sonatypeUsername | ||
password = rootProject.sonatypePassword | ||
close = "1" | ||
} | ||
} | ||
} | ||
if ("full".equals(rootProject.releaseMode)) { | ||
apply plugin: "com.vanniktech.maven.publish" | ||
|
||
fixPom() | ||
|
||
signing { | ||
if (project.hasProperty('SIGNING_PRIVATE_KEY') && project.hasProperty('SIGNING_PASSWORD')) { | ||
useInMemoryPgpKeys(project.getProperty('SIGNING_PRIVATE_KEY'), project.getProperty('SIGNING_PASSWORD')) | ||
} | ||
|
||
build.finalizedBy(bintrayUpload) | ||
} | ||
} | ||
} | ||
} | ||
|
||
apply from: file("gradle/javadoc_cleanup.gradle") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
release.scope=patch | ||
release.version=3.0.0-SNAPSHOT | ||
VERSION_NAME=3.0.0-SNAPSHOT | ||
|
||
GROUP=io.reactivex.rxjava3 | ||
POM_ARTIFACT_ID=rxjava | ||
POM_NAME=RxJava | ||
POM_PACKAGING=jar | ||
|
||
POM_DESCRIPTION=Reactive Extensions for Java | ||
POM_INCEPTION_YEAR=2013 | ||
|
||
POM_URL=https://github.com/akarnokd/RxJavaExtensions | ||
POM_SCM_URL=https://github.com/ReactiveX/RxJava | ||
POM_SCM_CONNECTION=scm:git:git://github.com/ReactiveX/RxJava.git | ||
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/ReactiveX/RxJava.git | ||
|
||
POM_LICENCE_NAME=The Apache Software License, Version 2.0 | ||
POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt | ||
POM_LICENCE_DIST=repo | ||
|
||
POM_DEVELOPER_ID=akarnokd | ||
POM_DEVELOPER_NAME=David Karnok | ||
POM_DEVELOPER_URL=https://github.com/akarnokd/ | ||
POM_DEVELOPER_EMAIL[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters