Update Gradle to 8.13 (#1008)

Also:

* Replace usages of deprecated APIs
* Prevent `testStart*` tasks from writing to standard output
This commit is contained in:
Daniel Chao
2025-03-03 12:08:48 -08:00
committed by GitHub
parent 3baefbcfd3
commit 5021107269
6 changed files with 12 additions and 8 deletions
@@ -23,7 +23,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
when (val taskNameSuffix = matchResult.groupValues[1]) { when (val taskNameSuffix = matchResult.groupValues[1]) {
"All" -> "All" ->
task("compatibilityTestAll") { tasks.register("compatibilityTestAll") {
dependsOn( dependsOn(
"compatibilityTestReleases", "compatibilityTestReleases",
"compatibilityTestCandidate", "compatibilityTestCandidate",
@@ -32,7 +32,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
} }
// releases in configured range // releases in configured range
"Releases" -> "Releases" ->
task("compatibilityTestReleases") { tasks.register("compatibilityTestReleases") {
val versionInfos = GradleVersionInfo.fetchReleases() val versionInfos = GradleVersionInfo.fetchReleases()
val allVersions = val allVersions =
versionInfos versionInfos
@@ -49,7 +49,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
} }
// latest release (if not developing against latest) // latest release (if not developing against latest)
"Latest" -> "Latest" ->
task("compatibilityTestLatest") { tasks.register("compatibilityTestLatest") {
val versionInfo = GradleVersionInfo.fetchCurrent() val versionInfo = GradleVersionInfo.fetchCurrent()
if (versionInfo.version == gradle.gradleVersion) { if (versionInfo.version == gradle.gradleVersion) {
doLast { doLast {
@@ -64,7 +64,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
} }
// active release candidate (if any) // active release candidate (if any)
"Candidate" -> "Candidate" ->
task("compatibilityTestCandidate") { tasks.register("compatibilityTestCandidate") {
val versionInfo = GradleVersionInfo.fetchRc() val versionInfo = GradleVersionInfo.fetchRc()
if (versionInfo?.activeRc == true) { if (versionInfo?.activeRc == true) {
dependsOn(createCompatibilityTestTask(versionInfo)) dependsOn(createCompatibilityTestTask(versionInfo))
@@ -74,7 +74,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
} }
// latest nightly // latest nightly
"Nightly" -> "Nightly" ->
task("compatibilityTestNightly") { tasks.register("compatibilityTestNightly") {
val versionInfo = GradleVersionInfo.fetchNightly() val versionInfo = GradleVersionInfo.fetchNightly()
dependsOn(createCompatibilityTestTask(versionInfo)) dependsOn(createCompatibilityTestTask(versionInfo))
} }
Binary file not shown.
+2 -2
View File
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94 distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -1
View File
@@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped. # and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line. # treated as '${Hostname}' itself on the command line.
+2
View File
@@ -14,6 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.io.OutputStream
import org.gradle.kotlin.dsl.support.serviceOf import org.gradle.kotlin.dsl.support.serviceOf
plugins { plugins {
@@ -148,6 +149,7 @@ private fun setupJavaExecutableRun(
null -> "java" null -> "java"
else -> launcher.get().executablePath.asFile.absolutePath else -> launcher.get().executablePath.asFile.absolutePath
} }
standardOutput = OutputStream.nullOutputStream()
args("-jar", javaExecutable.get().outputs.files.singleFile.toString(), *args) args("-jar", javaExecutable.get().outputs.files.singleFile.toString(), *args)
+2
View File
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import java.io.OutputStream
import java.nio.charset.StandardCharsets import java.nio.charset.StandardCharsets
import java.util.* import java.util.*
import kotlin.io.path.createDirectories import kotlin.io.path.createDirectories
@@ -77,6 +78,7 @@ private fun Exec.configureTestStartFatJar(launcher: Provider<JavaLauncher>) {
inputs.files(tasks.shadowJar) inputs.files(tasks.shadowJar)
executable = launcher.get().executablePath.asFile.absolutePath executable = launcher.get().executablePath.asFile.absolutePath
standardOutput = OutputStream.nullOutputStream()
argumentProviders.add( argumentProviders.add(
CommandLineArgumentProvider { CommandLineArgumentProvider {