Skip to content

Commit 0a45c15

Browse files
committed
3.x: Upgrade to Gradle 8.14, toolchains, Central release
1 parent a1b9655 commit 0a45c15

8 files changed

+39
-44
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: 3 additions & 0 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

.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: 23 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 {
@@ -54,6 +54,18 @@ java {
5454
targetCompatibility = JavaVersion.VERSION_1_8
5555
}
5656

57+
def buildWith11 = System.getenv("BUILD_WITH_11")
58+
java {
59+
toolchain {
60+
vendor = JvmVendorSpec.ADOPTIUM
61+
if ("true".equals(buildWith11)) {
62+
languageVersion = JavaLanguageVersion.of(11)
63+
} else {
64+
languageVersion = JavaLanguageVersion.of(8)
65+
}
66+
}
67+
}
68+
5769
tasks.withType(JavaCompile) {
5870
options.compilerArgs << "-parameters"
5971
}
@@ -86,12 +98,18 @@ animalsniffer {
8698
annotation = "io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer"
8799
}
88100

101+
moduleConfig {
102+
moduleInfoPath = 'src/main/module/module-info.java'
103+
multiReleaseVersion = 9
104+
}
105+
89106
jar {
90107
from('.') {
91108
include 'LICENSE'
92109
include 'COPYRIGHT'
93110
into('META-INF/')
94111
}
112+
exclude("module-info.class")
95113

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

113129
license {
@@ -166,8 +182,9 @@ jacocoTestReport {
166182
dependsOn testNG
167183

168184
reports {
169-
xml.enabled = true
170-
html.enabled = true
185+
xml.required.set(true)
186+
csv.required.set(false)
187+
html.required.set(true)
171188
}
172189
}
173190

@@ -184,39 +201,12 @@ checkstyle {
184201
if (project.hasProperty("releaseMode")) {
185202
logger.lifecycle("ReleaseMode: {}", project.releaseMode)
186203

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-
*/
207204

208205
if ("full" == project.releaseMode) {
209206
signing {
210207
if (project.hasProperty("SIGNING_PRIVATE_KEY") && project.hasProperty("SIGNING_PASSWORD")) {
211208
useInMemoryPgpKeys(project.getProperty("SIGNING_PRIVATE_KEY"), project.getProperty("SIGNING_PASSWORD"))
212209
}
213210
}
214-
/*
215-
mavenPublish {
216-
nexus {
217-
stagingProfile = "io.reactivex"
218-
}
219-
}
220-
*/
221211
}
222212
}

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)