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

View File

@@ -23,7 +23,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
when (val taskNameSuffix = matchResult.groupValues[1]) {
"All" ->
task("compatibilityTestAll") {
tasks.register("compatibilityTestAll") {
dependsOn(
"compatibilityTestReleases",
"compatibilityTestCandidate",
@@ -32,7 +32,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
}
// releases in configured range
"Releases" ->
task("compatibilityTestReleases") {
tasks.register("compatibilityTestReleases") {
val versionInfos = GradleVersionInfo.fetchReleases()
val allVersions =
versionInfos
@@ -49,7 +49,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
}
// latest release (if not developing against latest)
"Latest" ->
task("compatibilityTestLatest") {
tasks.register("compatibilityTestLatest") {
val versionInfo = GradleVersionInfo.fetchCurrent()
if (versionInfo.version == gradle.gradleVersion) {
doLast {
@@ -64,7 +64,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
}
// active release candidate (if any)
"Candidate" ->
task("compatibilityTestCandidate") {
tasks.register("compatibilityTestCandidate") {
val versionInfo = GradleVersionInfo.fetchRc()
if (versionInfo?.activeRc == true) {
dependsOn(createCompatibilityTestTask(versionInfo))
@@ -74,7 +74,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
}
// latest nightly
"Nightly" ->
task("compatibilityTestNightly") {
tasks.register("compatibilityTestNightly") {
val versionInfo = GradleVersionInfo.fetchNightly()
dependsOn(createCompatibilityTestTask(versionInfo))
}

Binary file not shown.

View File

@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

2
gradlew vendored
View File

@@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# 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.
# * 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.

View File

@@ -14,6 +14,7 @@
* limitations under the License.
*/
import java.io.ByteArrayOutputStream
import java.io.OutputStream
import org.gradle.kotlin.dsl.support.serviceOf
plugins {
@@ -148,6 +149,7 @@ private fun setupJavaExecutableRun(
null -> "java"
else -> launcher.get().executablePath.asFile.absolutePath
}
standardOutput = OutputStream.nullOutputStream()
args("-jar", javaExecutable.get().outputs.files.singleFile.toString(), *args)

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.OutputStream
import java.nio.charset.StandardCharsets
import java.util.*
import kotlin.io.path.createDirectories
@@ -77,6 +78,7 @@ private fun Exec.configureTestStartFatJar(launcher: Provider<JavaLauncher>) {
inputs.files(tasks.shadowJar)
executable = launcher.get().executablePath.asFile.absolutePath
standardOutput = OutputStream.nullOutputStream()
argumentProviders.add(
CommandLineArgumentProvider {