Skip to content

Commit 1d95451

Browse files
authored
3.x: Upgrade to Gradle 8.14, toolchains, Central release (#7868)
* 3.x: Upgrade to Gradle 8.14, toolchains, Central release * Fix checkstyle problem with module-info.java under 11 * javadoc error: try force compat settings * Just disable javadoc for build-11
1 parent a1b9655 commit 1d95451

8 files changed

+39
-46
lines changed

.github/workflows/gradle_branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19-
- name: Set up JDK 8
19+
- name: Set up JDK 11
2020
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2121
with:
2222
distribution: 'zulu'
23-
java-version: '8'
23+
java-version: '11'
2424
- name: Cache Gradle packages
2525
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2626
with:

.github/workflows/gradle_jdk11.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
permissions:
1313
contents: read
1414

15+
env:
16+
BUILD_WITH_11: true
17+
1518
jobs:
1619
build:
1720

@@ -35,5 +38,5 @@ jobs:
3538
run: ./gradlew -PjavaCompatibility=9 jar
3639
- name: Build RxJava
3740
run: ./gradlew build --stacktrace
38-
- name: Generate Javadoc
39-
run: ./gradlew javadoc --stacktrace
41+
# - name: Generate Javadoc
42+
# run: ./gradlew javadoc --stacktrace

.github/workflows/gradle_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19-
- name: Set up JDK 8
19+
- name: Set up JDK 11
2020
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2121
with:
2222
distribution: 'zulu'
23-
java-version: '8'
23+
java-version: '11'
2424
- name: Cache Gradle packages
2525
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2626
with:

.github/workflows/gradle_release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
CI_BUILD_NUMBER: ${{ github.run_number }}
2424
steps:
2525
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26-
- name: Set up JDK 8
26+
- name: Set up JDK 11
2727
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2828
with:
2929
distribution: 'zulu'
30-
java-version: '8'
30+
java-version: '11'
3131
- name: Cache Gradle packages
3232
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3333
with:
@@ -54,7 +54,7 @@ jobs:
5454
ORG_GRADLE_PROJECT_SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }}
5555
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
5656
- name: Publish release
57-
run: ./gradlew -PreleaseMode=full closeAndReleaseRepository --no-daemon --no-parallel --stacktrace
57+
run: ./gradlew -PreleaseMode=full publishAndReleaseToMavenCentral --no-configuration-cache --no-daemon --no-parallel --stacktrace
5858
env:
5959
# Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
6060
# ------------------------------------------------------------------------------

.github/workflows/gradle_snapshot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
CI_BUILD_NUMBER: ${{ github.run_number }}
2323
steps:
2424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25-
- name: Set up JDK 8
25+
- name: Set up JDK 11
2626
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2727
with:
2828
distribution: 'zulu'
29-
java-version: '8'
29+
java-version: '11'
3030
- name: Cache Gradle packages
3131
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3232
with:
@@ -40,7 +40,7 @@ jobs:
4040
- name: Build RxJava
4141
run: ./gradlew build --stacktrace --no-daemon
4242
- name: Upload Snapshot
43-
run: ./gradlew -PreleaseMode=branch publish --no-daemon --no-parallel --stacktrace
43+
run: ./gradlew -PreleaseMode=branch publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel --stacktrace
4444
env:
4545
# Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
4646
# ------------------------------------------------------------------------------

build.gradle

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ plugins {
88
id("me.champeau.gradle.jmh") version "0.5.3"
99
id("com.github.hierynomus.license") version "0.16.1"
1010
id("biz.aQute.bnd.builder") version "6.4.0"
11-
id("com.vanniktech.maven.publish") version "0.19.0"
12-
id("org.beryx.jar") version "1.2.0"
11+
id("com.vanniktech.maven.publish") version "0.32.0"
12+
id("org.beryx.jar") version "2.0.0"
1313
}
1414

1515
ext {
@@ -49,7 +49,16 @@ dependencies {
4949
testImplementation "com.google.guava:guava:$guavaVersion"
5050
}
5151

52+
def buildWith11 = System.getenv("BUILD_WITH_11")
5253
java {
54+
toolchain {
55+
vendor = JvmVendorSpec.ADOPTIUM
56+
if ("true".equals(buildWith11)) {
57+
languageVersion = JavaLanguageVersion.of(11)
58+
} else {
59+
languageVersion = JavaLanguageVersion.of(8)
60+
}
61+
}
5362
sourceCompatibility = JavaVersion.VERSION_1_8
5463
targetCompatibility = JavaVersion.VERSION_1_8
5564
}
@@ -86,12 +95,18 @@ animalsniffer {
8695
annotation = "io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer"
8796
}
8897

98+
moduleConfig {
99+
moduleInfoPath = 'src/main/module/module-info.java'
100+
multiReleaseVersion = 9
101+
}
102+
89103
jar {
90104
from('.') {
91105
include 'LICENSE'
92106
include 'COPYRIGHT'
93107
into('META-INF/')
94108
}
109+
exclude("module-info.class")
95110

96111
// Cover for bnd still not supporting MR Jars: https://github.com/bndtools/bnd/issues/2227
97112
bnd('-fixupmessages': '^Classes found in the wrong directory: \\\\{META-INF/versions/9/module-info\\\\.class=module-info}$')
@@ -106,8 +121,6 @@ jar {
106121
"Bundle-SymbolicName": "io.reactivex.rxjava3.rxjava",
107122
"Multi-Release": "true"
108123
)
109-
110-
moduleInfoPath = 'src/main/module/module-info.java'
111124
}
112125

113126
license {
@@ -166,8 +179,9 @@ jacocoTestReport {
166179
dependsOn testNG
167180

168181
reports {
169-
xml.enabled = true
170-
html.enabled = true
182+
xml.required.set(true)
183+
csv.required.set(false)
184+
html.required.set(true)
171185
}
172186
}
173187

@@ -179,44 +193,18 @@ checkstyle {
179193
"checkstyle.suppressions.file": project.file("config/checkstyle/suppressions.xml"),
180194
"checkstyle.header.file" : project.file("config/license/HEADER_JAVA")
181195
]
196+
checkstyleMain.exclude '**/module-info.java'
182197
}
183198

184199
if (project.hasProperty("releaseMode")) {
185200
logger.lifecycle("ReleaseMode: {}", project.releaseMode)
186201

187-
/*
188-
if ("branch" == project.releaseMode) {
189-
190-
if (version.endsWith("-SNAPSHOT")) {
191-
publishing {
192-
repositories {
193-
maven {
194-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
195-
}
196-
}
197-
}
198-
199-
mavenPublish {
200-
nexus {
201-
stagingProfile = "io.reactivex"
202-
}
203-
}
204-
}
205-
}
206-
*/
207202

208203
if ("full" == project.releaseMode) {
209204
signing {
210205
if (project.hasProperty("SIGNING_PRIVATE_KEY") && project.hasProperty("SIGNING_PASSWORD")) {
211206
useInMemoryPgpKeys(project.getProperty("SIGNING_PRIVATE_KEY"), project.getProperty("SIGNING_PASSWORD"))
212207
}
213208
}
214-
/*
215-
mavenPublish {
216-
nexus {
217-
stagingProfile = "io.reactivex"
218-
}
219-
}
220-
*/
221209
}
222210
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ POM_DEVELOPER_ID=akarnokd
2222
POM_DEVELOPER_NAME=David Karnok
2323
POM_DEVELOPER_URL=https://github.com/akarnokd/
2424
POM_DEVELOPER_EMAIL[email protected]
25+
26+
SONATYPE_HOST=CENTRAL_PORTAL
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)