Backport upgrade to Gradle 8.10.1

Cherry-pick commits d756bf4e86, 083ac67d13 and 162c929a80 to
upgrade to Gradle 8.10.1.

Closes gh-42433
This commit is contained in:
Phillip Webb
2024-09-24 11:30:14 -07:00
parent 23ddad1ebd
commit eafe61c4ca
23 changed files with 129 additions and 104 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,22 +18,17 @@ package org.springframework.boot.gradle.junit;
import java.io.File;
import org.gradle.api.JavaVersion;
import org.gradle.api.Project;
import org.gradle.internal.nativeintegration.services.NativeServices;
import org.gradle.testfixtures.ProjectBuilder;
import org.gradle.testfixtures.internal.ProjectBuilderImpl;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Helper class to build Gradle {@link Project Projects} for test fixtures. Wraps
* functionality of Gradle's own {@link ProjectBuilder} in order to work around an issue
* on JDK 17 and 18.
* functionality of Gradle's own {@link ProjectBuilder}.
*
* @author Christoph Dreis
* @see <a href="https://github.com/gradle/gradle/issues/16857">Gradle Support JDK 17</a>
*/
public final class GradleProjectBuilder {
@@ -67,14 +62,6 @@ public final class GradleProjectBuilder {
if (StringUtils.hasText(this.name)) {
builder.withName(this.name);
}
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
NativeServices.initializeOnClient(userHome);
try {
ProjectBuilderImpl.getGlobalServices();
}
catch (Throwable ignore) {
}
}
return builder.build();
}

View File

@@ -83,7 +83,7 @@ class KotlinPluginActionIntegrationTests {
configured.add(line.substring("Configuring :".length()));
}
}
assertThat(configured).containsExactlyInAnyOrder("help", "clean");
assertThat(configured).containsExactlyInAnyOrder("help", "compileJava", "clean");
}
}

View File

@@ -176,7 +176,7 @@ class BuildInfoTests {
Project project = GradleProjectBuilder.builder().withProjectDir(projectDir).withName(projectName).build();
((ProjectInternal) project).getServices()
.get(GradlePropertiesController.class)
.loadGradlePropertiesFrom(projectDir);
.loadGradlePropertiesFrom(projectDir, false);
return project;
}