From d8cf0616a6cb66a333a1989bc9602ebd239878df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Fri, 24 Sep 2021 15:11:33 +0200 Subject: [PATCH] Bump to Gradle 7.2, polish build and upgrade plugins/libraries (#2775) This commit migrates to Gradle 7.2, and upgrades most plugins (ensuring compatibility with Gradle 7) and libraries. As a result, some adjustments had to be made both to the build and to replace deprecated / removed APIs. The only exception is Byte Buddy in `reactor-tools`, for which a migration path isn't simple and will be treated separately in a following commit. See #2775 for a curated list of changes. --- benchmarks/build.gradle | 6 +- build.gradle | 94 ++++++++++-------- buildSrc/build.gradle | 4 +- .../io/reactor/gradle/JavaConventions.java | 55 +++++----- gradle/setup.gradle | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 58694 -> 58910 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 + gradlew.bat | 1 + reactor-core/build.gradle | 6 +- .../reactor/core/CurrentContextArchTest.java | 6 ++ .../reactor/core/QueueSubscriptionTest.java | 9 +- .../java/reactor/core/SwapDisposableTest.java | 2 +- .../core/publisher/FluxDetachTest.java | 6 +- .../core/publisher/FluxFlatMapTest.java | 4 +- .../core/publisher/MonoDetachTest.java | 6 +- .../core/scheduler/SingleSchedulerTest.java | 2 - .../java/reactor/test/StepVerifierTests.java | 8 +- reactor-tools/build.gradle | 30 +++--- .../reactor/tools/JarFileShadingTest.java | 6 ++ settings.gradle | 5 +- 21 files changed, 135 insertions(+), 121 deletions(-) diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index 0ed4d8bc35..633e322202 100644 --- a/benchmarks/build.gradle +++ b/benchmarks/build.gradle @@ -14,11 +14,11 @@ dependencies { // Use the baseline to avoid using new APIs in the benchmarks compileOnly "io.projectreactor:reactor-core:${perfBaselineVersion}" - implementation "org.openjdk.jmh:jmh-core:1.21" + implementation "org.openjdk.jmh:jmh-core:${jmhVersion}" implementation "io.projectreactor.addons:reactor-extra:3.3.3.RELEASE", { exclude group: 'io.projectreactor', module: 'reactor-core' } - annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:1.21" + annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}" current project(':reactor-core') baseline "io.projectreactor:reactor-core:${perfBaselineVersion}", { @@ -28,7 +28,7 @@ dependencies { task jmhProfilers(type: JavaExec, description:'Lists the available profilers for the jmh task', group: 'Development') { classpath = sourceSets.main.runtimeClasspath - main = 'org.openjdk.jmh.Main' + mainClass.set('org.openjdk.jmh.Main') args '-lprof' } diff --git a/build.gradle b/build.gradle index 6db420275b..6c004f3ec4 100644 --- a/build.gradle +++ b/build.gradle @@ -14,36 +14,36 @@ * limitations under the License. */ buildscript { - //we define kotlin version for benefit of both core and test (see kotlin-gradle-plugin below) - ext.kotlinVersion = '1.3.72' + // we define kotlin version for benefit of both core and test (see kotlin-gradle-plugin below) + ext.kotlinVersion = '1.5.31' repositories { mavenCentral() maven { url "https://repo.spring.io/plugins-release" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}" - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.24.5" //applied in individual submodules + classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.24.18" //applied in individual submodules } } plugins { - id "com.github.johnrengelman.shadow" version "4.0.2" - id 'org.asciidoctor.jvm.convert' version '3.3.0' apply false - id 'org.asciidoctor.jvm.pdf' version '3.3.0' apply false - id "me.champeau.gradle.japicmp" version "0.2.6" - id "de.undercouch.download" version "3.4.3" - id "org.unbroken-dome.test-sets" version "3.0.0" apply false - //note: build scan plugin now must be applied in settings.gradle - //plugin portal is now outdated due to bintray sunset, at least for artifactory gradle plugin - id 'biz.aQute.bnd.builder' version '5.0.1' apply false - id 'io.spring.nohttp' version '0.0.5.RELEASE' + id "com.github.johnrengelman.shadow" version "7.0.0" + id 'org.asciidoctor.jvm.convert' version '3.3.2' apply false + id 'org.asciidoctor.jvm.pdf' version '3.3.2' apply false + id "me.champeau.gradle.japicmp" version "0.3.0" + id "de.undercouch.download" version "4.1.2" + id "org.unbroken-dome.test-sets" version "4.0.0" apply false + // note: build scan plugin now must be applied in settings.gradle + // plugin portal is now outdated due to bintray sunset, at least for artifactory gradle plugin + id 'biz.aQute.bnd.builder' version '5.3.0' apply false + id 'io.spring.nohttp' version '0.0.9' id "io.github.reyerizo.gradle.jcstress" version "0.8.11" apply false - id "com.diffplug.spotless" version "5.14.0" + id "com.diffplug.spotless" version "5.15.0" } apply plugin: "io.reactor.gradle.detect-ci" -apply from: "gradle/asciidoc.gradle" //asciidoc (which is generated from root dir) +apply from: "gradle/asciidoc.gradle" // asciidoc (which is generated from root dir) apply from: "gradle/releaser.gradle" repositories { //needed at root for asciidoctor and nohttp-checkstyle @@ -65,28 +65,38 @@ ext { * Versions not necessarily bumped by a script (testing, etc...) below: */ // Misc not often upgraded - jsr305Version = '3.0.2' jsr166BackportVersion = '1.0.0.RELEASE' + // Used as a way to get jsr305 annotations. + // 3.0.1 is the last version that has the 'annotations' jar needed on the compile classpath + findbugsVersion = '3.0.1' // Blockhound - blockhoundVersion = '1.0.3.RELEASE' + blockhoundVersion = '1.0.6.RELEASE' // Logging - slf4jVersion = '1.7.12' - logbackVersion = '1.1.2' + slf4jVersion = '1.7.32' + logbackVersion = '1.2.5' // Testing - jUnitPlatformVersion = '5.6.0' - assertJVersion = '3.19.0' //needs to be manually synchronized in buildSrc - mockitoVersion = '2.23.0' - awaitilityVersion = '3.1.2' - throwingFunctionVersion = '1.5.0' - javaObjectLayoutVersion = '0.9' - testNgVersion = '6.8.5' + jUnitPlatformVersion = '5.8.0' //needs to be manually synchronized in buildSrc + assertJVersion = '3.21.0' //needs to be manually synchronized in buildSrc + mockitoVersion = '3.12.4' + awaitilityVersion = '4.1.0' + throwingFunctionVersion = '1.5.1' + javaObjectLayoutVersion = '0.16' + testNgVersion = '7.4.0' + archUnitVersion = '0.21.0' + + // For reactor-tools + byteBuddyVersion = '1.10.9' //sync with plugin version above //TODO bump to 1.11.16 with breaking changes + cgLibVersion = '3.3.0' + + // JMH + jmhVersion = '1.33' } -//only publish scan if a specific gradle entreprise server is passed -//typically, for local usage, you would temporarily set the env with: +// only publish scan if a specific gradle entreprise server is passed +// typically, for local usage, you would temporarily set the env with: // `GRADLE_ENTERPRISE_URL=https://myge.example.com/ gradle foo` if (System.getenv('GRADLE_ENTERPRISE_URL')) { gradleEnterprise { @@ -157,24 +167,20 @@ configure(subprojects) { p -> maven { url 'https://repo.spring.io/milestone' } } - jacoco { - toolVersion = '0.8.5' - } - jacocoTestReport { reports { - xml.enabled = true - html.enabled = true + xml.required = true + html.required = true } } - //includes for base test task (see below for additional common configurations) + // includes for base test task (see below for additional common configurations) test { include '**/*Tests.*' include '**/*Test.*' } - //all test tasks will show FAILED for each test method, + // all test tasks will show FAILED for each test method, // common exclusions, no scanning p.tasks.withType(Test).all { testLogging { @@ -185,10 +191,10 @@ configure(subprojects) { p -> maxGranularity 3 } - //show progress by displaying test classes, avoiding test suite timeouts + // show progress by displaying test classes, avoiding test suite timeouts TestDescriptor last - afterTest { TestDescriptor td, TestResult tr -> - if (last != td.getParent()) { + beforeTest { TestDescriptor td -> + if (last != td.getParent() && td.getParent().toString().startsWith("Test class")) { last = td.getParent() println last } @@ -216,7 +222,7 @@ configure(subprojects) { p -> } if (JavaVersion.current().isJava9Compatible()) { - println "Java 9+: lowering MaxGCPauseMillis to 20ms in ${project.name} ${name}" + println "Java ${JavaVersion.current()}: lowering MaxGCPauseMillis to 20ms in ${project.name} ${name}" jvmArgs = ["-XX:MaxGCPauseMillis=20"] } @@ -226,11 +232,11 @@ configure(subprojects) { p -> exclude '**/*Abstract*.*' exclude '**/*OperatorTest*.*' - //allow re-run of failed tests only without special test tasks failing + // allow re-run of failed tests only without special test tasks failing // because the filter is too restrictive filter.setFailOnNoMatchingTests(false) - //display intermediate results for special test tasks + // display intermediate results for special test tasks afterSuite { desc, result -> if (!desc.parent) { // will match the outermost suite println('\n' + "${desc} Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)") @@ -242,11 +248,11 @@ configure(subprojects) { p -> assemble.dependsOn docsZip configure(subprojects) { p -> - //these apply once the above configure is done, but before project-specific build.gradle have applied + // these apply once the above configure is done, but before project-specific build.gradle have applied apply plugin: "io.reactor.gradle.java-conventions" apply from: "${rootDir}/gradle/javadoc.gradle" - //these apply AFTER project-specific build.gradle have applied + // these apply AFTER project-specific build.gradle have applied afterEvaluate { if (p.plugins.hasPlugin("kotlin")) { println "Applying Kotlin conventions to ${p.name}" diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 5e2de5a515..95f8526966 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -24,8 +24,8 @@ repositories { } dependencies { - testImplementation("org.assertj:assertj-core:3.19.0") - testImplementation platform("org.junit:junit-bom:5.6.0") + testImplementation("org.assertj:assertj-core:3.21.0") + testImplementation platform("org.junit:junit-bom:5.8.0") testImplementation "org.junit.jupiter:junit-jupiter-api" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" } diff --git a/buildSrc/src/main/java/io/reactor/gradle/JavaConventions.java b/buildSrc/src/main/java/io/reactor/gradle/JavaConventions.java index b410fbff99..f774950d24 100644 --- a/buildSrc/src/main/java/io/reactor/gradle/JavaConventions.java +++ b/buildSrc/src/main/java/io/reactor/gradle/JavaConventions.java @@ -24,7 +24,7 @@ import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.plugins.JavaPlugin; -import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.tasks.compile.JavaCompile; /** @@ -38,37 +38,36 @@ public void apply(Project project) { } private void applyJavaConvention(Project project) { - JavaPluginConvention java = project.getConvention().getPlugin(JavaPluginConvention.class); + JavaPluginExtension java = project.getExtensions().getByType(JavaPluginExtension.class); java.setSourceCompatibility(JavaVersion.VERSION_1_8); java.setTargetCompatibility(JavaVersion.VERSION_1_8); project.getTasks() - .withType(JavaCompile.class) - .forEach(compileTask -> { - compileTask.getOptions().setEncoding("UTF-8"); - compileTask.getOptions().setCompilerArgs(Arrays.asList( - "-Xlint:-varargs", // intentionally disabled - "-Xlint:cast", - "-Xlint:classfile", - "-Xlint:dep-ann", - "-Xlint:divzero", - "-Xlint:empty", - "-Xlint:finally", - "-Xlint:overrides", - "-Xlint:path", - "-Xlint:processing", - "-Xlint:static", - "-Xlint:try", - "-Xmaxerrs", "500", - "-Xmaxwarns", "500", - "-Xlint:deprecation", - "-Xlint:unchecked", - "-Xlint:-serial", // intentionally disabled - "-Xlint:-options", // intentionally disabled - "-Xlint:-fallthrough", // intentionally disabled - "-Xlint:-rawtypes" // TODO enable and fix warnings - )); - }); + .withType(JavaCompile.class) + .forEach(compileTask -> { + compileTask.getOptions().setEncoding("UTF-8"); + compileTask.getOptions().setCompilerArgs(Arrays.asList( + "-Xlint:-varargs", // intentionally disabled + "-Xlint:cast", + "-Xlint:classfile", + "-Xlint:dep-ann", + "-Xlint:divzero", + "-Xlint:empty", + "-Xlint:finally", + "-Xlint:overrides", + "-Xlint:path", + "-Xlint:-processing", + "-Xlint:static", + "-Xlint:try", + "-Xlint:deprecation", + "-Xlint:unchecked", + "-Xlint:-serial", // intentionally disabled + "-Xlint:-options", // intentionally disabled + "-Xlint:-fallthrough", // intentionally disabled + "-Xmaxerrs", "500", + "-Xmaxwarns", "1000" + )); + }); if (JavaVersion.current().isJava8Compatible()) { project.getTasks().withType(JavaCompile.class, t -> { diff --git a/gradle/setup.gradle b/gradle/setup.gradle index 31df227d03..45277ab079 100644 --- a/gradle/setup.gradle +++ b/gradle/setup.gradle @@ -156,7 +156,7 @@ if (qualifyVersion("$version") in ["RELEASE", "MILESTONE"] || rootProject.hasPro signing { //requiring signature if there is a publish task that is not to MavenLocal - required { gradle.taskGraph.allTasks.any { it.name.toLowerCase().contains("publish") && !it.name.contains("MavenLocal") } } + required { gradle.taskGraph.allTasks.any { it.name.toLowerCase().contains("publish") && !it.name.contains("MavenLocal") && !it.name.contains("MockRepository") } } def signingKey = findProperty("signingKey") def signingPassword = findProperty("signingPassword") diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 490fda8577df6c95960ba7077c43220e5bb2c0d9..62d4c053550b91381bbd28b1afc82d634bf73a8a 100644 GIT binary patch delta 6447 zcmY*dbyQSczlH%shY+L(kQ}C6ise@?c@F%#`dE9xT=qM=Dm?$VxD1hrECD1a#01Q8o zMyT3}z+1K>hPE%4doH=x5X;^NP(OFD5GByp;5FQ^bpzkBa(;eudMu7Iyv$DE+N=>p z{3Y5_BP>F3)tXW*Styc(Ji3jnK-giGA_&42fsbZ@#+e+ly3w0VmLC;LA)h1UY(ChA zfwqQ?-@}@S93F|exOv;Se;P|SrYvEG(8q&|ltqvQHO9KgCSwM!Y+#d5eIRq$Mi`pU__N$FTxW@KAWIw= zayY6@9EyxG<_tr&{Wi87m5*mf=u&=;eL1gf{Mt)q8Drick8CcxzLW>cG~TbW)|$*D zYMc|5eZNNzt7O_C1LqgaI`Z0B+2#;3yO;E7N4oMY@~7$4;MRonU+Ca z#*cD!7$u9pZ|3f!-_6rpN}XhAWd`1qiR{e*1CJK1dvBsjUyY@BuT|;EAz}*0uSwT_ zq(g0jXTAK4wsQ>kIKEfRQZw^GIKNRZmV)b;c*Kpc?IvNuq{+eCM4%IBoRUk!JeJ4IVH!pLl+5gQn^$0Fw(WROw~SclOYWbMmvR+x&lYa zrU`5lck*s2zl;n6HEa_E|Btu!_BeeF8T=~0Z-pdJsKtN8nr88*8loznbI`@@8U-bc zCE&MaHH#?LN;6&wU%>->{X&6n*c6ECkP#Bn{lafo9KW+AKK>>f)YfzG#t`XCsl$WX zeS|50l&G{J6yrdD0#njv3|C}K(~azN%1+c#*-JXtZd=Rs-zr)f{Mneaqpgewz^3OM5FaDaH3?RpqMyL}=5sFu_zcDc^E~=$H zp`mutZ0ahrf32c`6ROBh&lI`>vuFJE*(NV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>hskR-1I9Sx7b4i6p>2LP#vgtG6;8vGL>E3$NPQ$J2r~XGQDNg;Sw=& zC}lz+3@Sq%I2q-97R&9|8Ij2^?^DGQK_oiqZS2$!-rzVqn=~d~TS{n&I+svxt4dWO zT?K0)JEx>9E7saW8h!5+MmAkC`g~v*@ z6VKn0>eZdon>BH(O$mACnxk3D?vSlCFFnvZ#+&hUs)Wr!aP{<@|oc^G>bJk59^xhmz!RA%|K_$o)V`D@gVs>@bSmXVID_PQXp znfja8U01+t3V!o{8ZKi~G@#q$KrAH-Ks3$G{Qo}H|N1ijJMsgZDgOmM1O$Fi0>0CX zpbAzXhYbP@PV;~=*nn7eQGjoT2b9nGFNg-PpHT$a@?7JL7I&pmkmclS7#Y#zRYg_`D0h47O z&|%88tXNh8{Yk$@@*HA-B9r#tDkY$>!U#Ie`j1TupjRn@;(ykyyld-zJ{@qm!UG~I zxR#ZxV8CEi5JXV?ANc~bS9*;MYtkTvifc5iynmg!XpIr%SN*R#E?|3&2QVs~N02d=N!1;GdfNGr)gc$|K#-y*M=Ra9B4#cmk-naoQuS*cWnE3C4 F{|nTN-B$nr diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bb8b2fc26b..ffed3a254e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 2fe81a7d95..fbd7c51583 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 9109989e3c..a9f778a7a9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -84,6 +84,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% diff --git a/reactor-core/build.gradle b/reactor-core/build.gradle index e70ff0f74e..46817e5407 100644 --- a/reactor-core/build.gradle +++ b/reactor-core/build.gradle @@ -63,8 +63,8 @@ dependencies { } // JSR-305 annotations - compileOnly "com.google.code.findbugs:jsr305:$jsr305Version" - testCompileOnly "com.google.code.findbugs:jsr305:$jsr305Version" + compileOnly "com.google.code.findbugs:jsr305:$findbugsVersion" + testCompileOnly "com.google.code.findbugs:jsr305:$findbugsVersion" //Optional Logging Operator compileOnly "org.slf4j:slf4j-api:$slf4jVersion" @@ -102,7 +102,7 @@ dependencies { testImplementation "org.openjdk.jol:jol-core:$javaObjectLayoutVersion" testImplementation "org.awaitility:awaitility:$awaitilityVersion" testImplementation "com.pivovarit:throwing-function:$throwingFunctionVersion" - testImplementation "com.tngtech.archunit:archunit:0.12.0" + testImplementation "com.tngtech.archunit:archunit:$archUnitVersion" // withMicrometerTest is a test-set that validates what happens when micrometer *IS* // on the classpath. Needs sourceSets.test.output because tests there use helpers like AutoDisposingRule etc. diff --git a/reactor-core/src/test/java/reactor/core/CurrentContextArchTest.java b/reactor-core/src/test/java/reactor/core/CurrentContextArchTest.java index 4294bfda98..09f5fc5000 100644 --- a/reactor-core/src/test/java/reactor/core/CurrentContextArchTest.java +++ b/reactor-core/src/test/java/reactor/core/CurrentContextArchTest.java @@ -29,6 +29,7 @@ import reactor.core.publisher.FluxProcessor; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; +import static org.assertj.core.api.Assertions.assertThat; public class CurrentContextArchTest { @@ -42,6 +43,11 @@ public class CurrentContextArchTest { .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_JARS) .importPackagesOf(FluxProcessor.class); + @Test + void smokeTestWhereClassesLoaded() { + assertThat(CORE_SUBSCRIBER_CLASSES).isNotEmpty(); + } + @Test public void corePublishersShouldNotUseDefaultCurrentContext() { classes() diff --git a/reactor-core/src/test/java/reactor/core/QueueSubscriptionTest.java b/reactor-core/src/test/java/reactor/core/QueueSubscriptionTest.java index 1b8aba134c..ba51ab6c44 100644 --- a/reactor-core/src/test/java/reactor/core/QueueSubscriptionTest.java +++ b/reactor-core/src/test/java/reactor/core/QueueSubscriptionTest.java @@ -77,9 +77,14 @@ public String toString() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> { - assertThat(queueSubscription).isNull(); + assertThat(queueSubscription).isSameAs("foo"); }) - .withMessage("\n" + "expected: null\n" + "but was : ThisIsNotAQueue"); + .withMessage("\n" + + "Expecting actual:\n" + + " \"foo\"\n" + + "and actual:\n" + + " ThisIsNotAQueue\n" + + "to refer to the same object"); } } diff --git a/reactor-core/src/test/java/reactor/core/SwapDisposableTest.java b/reactor-core/src/test/java/reactor/core/SwapDisposableTest.java index c053d3e37f..e1e75a6210 100644 --- a/reactor-core/src/test/java/reactor/core/SwapDisposableTest.java +++ b/reactor-core/src/test/java/reactor/core/SwapDisposableTest.java @@ -83,7 +83,7 @@ public void unsubscribingTwiceDoesUnsubscribeOnce() { public void settingSameDisposableTwiceDoesUnsubscribeIt() { Disposable underlying = mock(Disposable.class); sequentialDisposable.update(underlying); - verifyZeroInteractions(underlying); + verifyNoInteractions(underlying); sequentialDisposable.update(underlying); verify(underlying).dispose(); } diff --git a/reactor-core/src/test/java/reactor/core/publisher/FluxDetachTest.java b/reactor-core/src/test/java/reactor/core/publisher/FluxDetachTest.java index 6ddfc1c401..bf5705e759 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/FluxDetachTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/FluxDetachTest.java @@ -17,10 +17,10 @@ package reactor.core.publisher; import java.lang.ref.WeakReference; +import java.time.Duration; import java.util.concurrent.atomic.AtomicReference; import org.awaitility.Awaitility; -import org.awaitility.Duration; import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -147,9 +147,9 @@ public void justUnsubscribed() throws Exception { ts.cancel(); o = null; - Awaitility.with().pollDelay(Duration.ZERO).pollInterval(Duration.ONE_MILLISECOND) + Awaitility.with().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(1)) .await() - .atMost(Duration.FIVE_SECONDS) + .atMost(Duration.ofSeconds(5)) .untilAsserted(() -> { System.gc(); Object garbage = new Object(); diff --git a/reactor-core/src/test/java/reactor/core/publisher/FluxFlatMapTest.java b/reactor-core/src/test/java/reactor/core/publisher/FluxFlatMapTest.java index 244ec73402..dc3fd1c149 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/FluxFlatMapTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/FluxFlatMapTest.java @@ -1730,9 +1730,9 @@ public void errorModeContinueInternalErrorStopStrategyAsync() { .expectComplete() .verifyThenAssertThat(); - Awaitility.with().pollDelay(org.awaitility.Duration.ZERO).pollInterval(org.awaitility.Duration.ONE_MILLISECOND) + Awaitility.with().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(1)) .await() - .atMost(org.awaitility.Duration.ONE_SECOND) + .atMost(Duration.ofSeconds(1)) .untilAsserted(() -> assertions.hasNotDroppedElements().hasDroppedErrors(1)); } } diff --git a/reactor-core/src/test/java/reactor/core/publisher/MonoDetachTest.java b/reactor-core/src/test/java/reactor/core/publisher/MonoDetachTest.java index b4b6585af8..a559c92335 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/MonoDetachTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/MonoDetachTest.java @@ -17,10 +17,10 @@ package reactor.core.publisher; import java.lang.ref.WeakReference; +import java.time.Duration; import java.util.concurrent.atomic.AtomicReference; import org.awaitility.Awaitility; -import org.awaitility.Duration; import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import reactor.test.subscriber.AssertSubscriber; @@ -127,9 +127,9 @@ public void justUnsubscribed() throws Exception { ts.cancel(); o = null; - Awaitility.with().pollDelay(Duration.ZERO).pollInterval(Duration.ONE_MILLISECOND) + Awaitility.with().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(1)) .await() - .atMost(Duration.FIVE_SECONDS) + .atMost(Duration.ofSeconds(5)) .untilAsserted(() -> { System.gc(); Object garbage = new Object(); diff --git a/reactor-core/src/test/java/reactor/core/scheduler/SingleSchedulerTest.java b/reactor-core/src/test/java/reactor/core/scheduler/SingleSchedulerTest.java index 04eb6bc330..56d10a149f 100644 --- a/reactor-core/src/test/java/reactor/core/scheduler/SingleSchedulerTest.java +++ b/reactor-core/src/test/java/reactor/core/scheduler/SingleSchedulerTest.java @@ -24,8 +24,6 @@ import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicLong; -import org.junit.*; - import org.junit.jupiter.api.Test; import reactor.core.Scannable; import reactor.core.publisher.*; diff --git a/reactor-test/src/test/java/reactor/test/StepVerifierTests.java b/reactor-test/src/test/java/reactor/test/StepVerifierTests.java index 5644d1c59f..e36aff2c33 100644 --- a/reactor-test/src/test/java/reactor/test/StepVerifierTests.java +++ b/reactor-test/src/test/java/reactor/test/StepVerifierTests.java @@ -253,7 +253,7 @@ void assertNext() throws Exception { .assertNext(s -> assertThat(s).endsWith("ooz")) .expectComplete() .verify()) - .withMessage("\nExpecting:\n \"foo\"\nto end with:\n \"ooz\"\n"); + .withMessage("\nExpecting actual:\n \"foo\"\nto end with:\n \"ooz\"\n"); } @Test @@ -2460,7 +2460,7 @@ void collectMultipleTimes_detectsUnexpectedCollectedElement1() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(stepVerifier::verify) .withMessage("\n" + - "Expecting:\n" + + "Expecting actual:\n" + " [1, 2, 3, 4, 5]\n" + "to contain exactly (and in same order):\n" + " [1, 5]\n" + @@ -2484,7 +2484,7 @@ void collectMultipleTimes_detectsUnexpectedCollectedElement2() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(stepVerifier::verify) .withMessage("\n" + - "Expecting:\n" + + "Expecting actual:\n" + " [6, 7, 8, 9, 10]\n" + "to contain exactly (and in same order):\n" + " [6, 10]\n" + @@ -2506,7 +2506,7 @@ void collectAfterFirst_reportsAssertionFailure() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(stepVerifier::verify) .withMessage("\n" + - "Expecting:\n" + + "Expecting actual:\n" + " [2, 3, 4, 5, 6, 7, 8, 9, 10]\n" + "to contain exactly (and in same order):\n" + " [2, 3, 4, 5, 6, 7, 8, 9]\n" + diff --git a/reactor-tools/build.gradle b/reactor-tools/build.gradle index 615a473d58..2947650e74 100644 --- a/reactor-tools/build.gradle +++ b/reactor-tools/build.gradle @@ -15,7 +15,7 @@ */ plugins { - id 'net.bytebuddy.byte-buddy-gradle-plugin' version '1.10.9' apply false + id 'net.bytebuddy.byte-buddy-gradle-plugin' version "$byteBuddyVersion" apply false } apply plugin: 'com.github.johnrengelman.shadow' @@ -37,22 +37,22 @@ configurations { dependencies { api project(":reactor-core") - shaded 'net.bytebuddy:byte-buddy-agent:1.10.9' - shaded 'net.bytebuddy:byte-buddy:1.10.9' + shaded "net.bytebuddy:byte-buddy-agent:$byteBuddyVersion" + shaded "net.bytebuddy:byte-buddy:$byteBuddyVersion" for (dependency in project.configurations.shaded.dependencies) { compileOnly(dependency) - testRuntime(dependency) - javaAgentTestRuntime(dependency) + testRuntimeOnly(dependency) + javaAgentTestRuntimeOnly(dependency) } testImplementation platform("org.junit:junit-bom:${jUnitPlatformVersion}") testImplementation "org.junit.jupiter:junit-jupiter-api" - testRuntime "org.junit.jupiter:junit-jupiter-engine" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" testImplementation "org.assertj:assertj-core:$assertJVersion" - testImplementation 'cglib:cglib:3.3.0' + testImplementation "cglib:cglib:$cgLibVersion" - jarFileTestImplementation 'org.assertj:assertj-core:$assertJVersion' + jarFileTestImplementation "org.assertj:assertj-core:$assertJVersion" } test { @@ -99,7 +99,7 @@ shadowJar { .toSet() // Exclude every compile-scoped dependency (including the transitive ones) - for (id in project.configurations.compile.resolvedConfiguration.resolvedArtifacts*.moduleVersion*.id) { + for (id in project.configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts*.moduleVersion*.id) { def module = "${id.group}:${id.name}".toString() if (!shadedDependencies.contains(module)) { project.configurations.shaded.exclude(group: id.group, module: id.name) @@ -108,13 +108,7 @@ shadowJar { } } } - - exclude 'module-info.class' - exclude 'META-INF/*' - exclude 'META-INF/maven*/**' - exclude 'META-INF/versions/*' - exclude 'META-INF/licenses/*' - + exclude 'META-INF/**' // TODO discuss with ByteBuddy folks how to shade it exclude 'win32-x86*/**' } @@ -139,7 +133,7 @@ task shadedJarTest(type: Test) { Set mainOutputs = [ project.sourceSets.main.output.resourcesDir, - project.sourceSets.main.java.outputDir, + project.sourceSets.main.java.classesDirectory, ] classpath = shadowJar.outputs.files @@ -188,7 +182,7 @@ tasks.withType(Test).all { artifact(shadowJar) } } -configurations.runtime.outgoing.artifacts.clear() +configurations.runtimeOnly.outgoing.artifacts.clear() //add original jar to the publication publishing.publications.mavenJava.artifact(jar) diff --git a/reactor-tools/src/jarFileTest/java/reactor/tools/JarFileShadingTest.java b/reactor-tools/src/jarFileTest/java/reactor/tools/JarFileShadingTest.java index aea9e36768..e91d143d68 100644 --- a/reactor-tools/src/jarFileTest/java/reactor/tools/JarFileShadingTest.java +++ b/reactor-tools/src/jarFileTest/java/reactor/tools/JarFileShadingTest.java @@ -49,6 +49,12 @@ public void testMetaInf() throws Exception { ); } + @Test + void testNoMetaInfInShaded() throws IOException { + assertThatFileList(root.resolve("reactor/tools/shaded")) + .containsOnly("net"); + } + private ListAssert assertThatFileList(Path path) throws IOException { return (ListAssert) assertThat(Files.list(path)) .extracting(Path::getFileName) diff --git a/settings.gradle b/settings.gradle index cb2f7d16ae..c6ec1fccbc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -19,7 +19,4 @@ plugins { rootProject.name = 'reactor' -include 'benchmarks', 'reactor-core', 'reactor-test', 'reactor-tools' - -// See https://docs.gradle.org/6.5.1/release-notes.html. Drop once using Gradle 7.0+ -enableFeaturePreview("VERSION_ORDERING_V2") \ No newline at end of file +include 'benchmarks', 'reactor-core', 'reactor-test', 'reactor-tools' \ No newline at end of file