Skip to content

Commit ad0ac6c

Browse files
Update Gradle task dependencies to remove dependsOn 'build' task
It is generally discouraged to add dependencies on 'build', so 'javadocCleanup' and 'jacocoTestReport' have been removed and put on better tasks. Also, 'jacocoTestReport' needs input from the test results. Updated task dependencies: - Gradle 'javadoc' task is finalized by 'javadocCleanup', and 'javadocCleanup' no longer directly invoked by 'build' - Gradle 'jacocoTestReport' task run by 'check' instead of 'build', and 'jacocoTestReport' depends on 'test' and 'testng' Changes due to dependency updates: - Add 'javadoc' generation task on Github actions that only 'build' - Remove 'javadocCleanup' task from Github action as 'publish...' tasks already dependent on 'javadoc' Miscellaneous tangential cleanup: - Remove "pr" parameter on command line in Github workflow as parameter is no longer functional - Enclose source/target compatibility in Gradle java block
1 parent 93e5216 commit ad0ac6c

File tree

7 files changed

+25
-16
lines changed

7 files changed

+25
-16
lines changed

.github/workflows/gradle_branch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
- name: Grant execute permission for gradlew
2828
run: chmod +x gradlew
2929
- name: Build branch without snapshot
30-
run: ./gradlew -PreleaseMode=pr build --stacktrace
30+
run: ./gradlew build --stacktrace
3131
- name: Upload to Codecov
3232
uses: codecov/codecov-action@v1
33+
- name: Generate Javadocs
34+
run: ./gradlew javadoc --stacktrace

.github/workflows/gradle_jdk11.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
- name: Grant execute permission for gradlew
3030
run: chmod +x gradlew
3131
- name: Build PR
32-
run: ./gradlew -PreleaseMode=pr build --stacktrace
33-
#- name: Upload to Codecov
34-
# uses: codecov/codecov-action@v1
32+
run: ./gradlew build --stacktrace
33+
- name: Generate Javadocs
34+
run: ./gradlew javadoc --stacktrace

.github/workflows/gradle_pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build a Java project with Gradle
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
33

4-
name: PR
4+
name: Pull Request
55

66
on:
77
pull_request:
@@ -27,6 +27,8 @@ jobs:
2727
- name: Grant execute permission for gradlew
2828
run: chmod +x gradlew
2929
- name: Build PR
30-
run: ./gradlew -PreleaseMode=pr build --stacktrace
30+
run: ./gradlew build --stacktrace
3131
- name: Upload to Codecov
3232
uses: codecov/codecov-action@v1
33+
- name: Generate Javadocs
34+
run: ./gradlew javadoc --stacktrace

.github/workflows/gradle_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Upload to Codecov
4141
uses: codecov/codecov-action@v1
4242
- name: Upload release
43-
run: ./gradlew -PreleaseMode=full javadocCleanup uploadArchives --no-daemon --no-parallel --stacktrace
43+
run: ./gradlew -PreleaseMode=full uploadArchives --no-daemon --no-parallel --stacktrace
4444
env:
4545
# Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
4646
# ------------------------------------------------------------------------------

.github/workflows/gradle_snapshot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Build and Snapshot branch
3535
run: ./gradlew -PreleaseMode=branch build --stacktrace --no-daemon
3636
- name: Upload Snapshot
37-
run: ./gradlew -PreleaseMode=branch javadocCleanup uploadArchives --no-daemon --no-parallel --stacktrace
37+
run: ./gradlew -PreleaseMode=branch uploadArchives --no-daemon --no-parallel --stacktrace
3838
env:
3939
# Define secrets at https://github.com/ReactiveX/RxJava/settings/secrets/actions
4040
# ------------------------------------------------------------------------------
@@ -48,4 +48,3 @@ jobs:
4848
# ------------------------------------------------------------------------------
4949
env:
5050
JAVADOCS_TOKEN: ${{ secrets.JAVADOCS_TOKEN }}
51-

build.gradle

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ group = "io.reactivex.rxjava3"
3636
version = project.properties["VERSION_NAME"]
3737
description = "RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM."
3838

39-
sourceCompatibility = JavaVersion.VERSION_1_8
40-
targetCompatibility = JavaVersion.VERSION_1_8
41-
4239
repositories {
4340
mavenCentral()
4441
}
@@ -57,10 +54,17 @@ dependencies {
5754
testImplementation "com.google.guava:guava:$guavaVersion"
5855
}
5956

57+
java {
58+
sourceCompatibility = JavaVersion.VERSION_1_8
59+
targetCompatibility = JavaVersion.VERSION_1_8
60+
}
61+
6062
tasks.withType(JavaCompile) {
6163
options.compilerArgs << "-parameters"
6264
}
6365

66+
apply from: file("gradle/javadoc_cleanup.gradle")
67+
6468
javadoc {
6569
failOnError = false
6670
exclude "**/internal/**"
@@ -80,6 +84,8 @@ javadoc {
8084
"https://docs.oracle.com/javase/8/docs/api/",
8185
"http://www.reactive-streams.org/reactive-streams-${reactiveStreamsVersion}-javadoc/"
8286
)
87+
88+
finalizedBy javadocCleanup
8389
}
8490

8591
animalsniffer {
@@ -172,13 +178,16 @@ jacoco {
172178
}
173179

174180
jacocoTestReport {
181+
dependsOn test
182+
dependsOn testng
183+
175184
reports {
176185
xml.enabled = true
177186
html.enabled = true
178187
}
179188
}
180189

181-
build.dependsOn jacocoTestReport
190+
check.dependsOn jacocoTestReport
182191

183192
checkstyle {
184193
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
@@ -189,8 +198,6 @@ checkstyle {
189198
]
190199
}
191200

192-
apply from: file("gradle/javadoc_cleanup.gradle")
193-
194201
if (rootProject.hasProperty("releaseMode")) {
195202
logger.lifecycle("ReleaseMode: {}", rootProject.releaseMode)
196203

gradle/javadoc_cleanup.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ def fixJavadocFile(file) {
5757
file.setText(fileContents, 'UTF-8');
5858
}
5959

60-
build.dependsOn javadocCleanup

0 commit comments

Comments
 (0)