Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gradle wrapper to 7.2 #75894

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build-tools-internal/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=9bb8bc05f562f2d42bdf1ba8db62f6b6fa1c3bf6c392228802cc7cb0578fe7e0
distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.elasticsearch.gradle.Version;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.logging.LogLevel;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.TaskProvider;
Expand Down Expand Up @@ -65,11 +66,14 @@ private TaskProvider<LoggedExec> createRunBwcGradleTask(Project project, String
loggedExec.usesService(bwcTaskThrottleProvider);
loggedExec.setSpoolOutput(true);
loggedExec.setWorkingDir(checkoutDir.get());
loggedExec.doFirst(t -> {
// Execution time so that the checkouts are available
String compilerVersionInfoPath = minimumCompilerVersionPath(unreleasedVersionInfo.get().version);
String minimumCompilerVersion = readFromFile(new File(checkoutDir.get(), compilerVersionInfoPath));
loggedExec.environment("JAVA_HOME", getJavaHome(Integer.parseInt(minimumCompilerVersion)));
loggedExec.doFirst(new Action<Task>() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lambdas as task actions are now deprecated. therefore we do not need a comment here as the build would fail to signal this anyhow

@Override
public void execute(Task t) {
// Execution time so that the checkouts are available
String compilerVersionInfoPath = minimumCompilerVersionPath(unreleasedVersionInfo.get().version);
String minimumCompilerVersion = readFromFile(new File(checkoutDir.get(), compilerVersionInfoPath));
loggedExec.environment("JAVA_HOME", getJavaHome(Integer.parseInt(minimumCompilerVersion)));
}
});

if (Os.isFamily(Os.FAMILY_WINDOWS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.elasticsearch.gradle.Version;
import org.elasticsearch.gradle.internal.info.BuildParams;
import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin;
import org.gradle.api.Action;
import org.gradle.api.InvalidUserDataException;
import org.gradle.api.Project;
import org.gradle.api.Task;
Expand Down Expand Up @@ -237,14 +238,16 @@ static void createBuildBwcTask(
if (project.getGradle().getStartParameter().isBuildCacheEnabled()) {
c.args("--build-cache");
}
c.doLast(task -> {
if (expectedOutputFile.exists() == false) {
throw new InvalidUserDataException(
"Building " + bwcVersion.get() + " didn't generate expected artifact " + expectedOutputFile
);
c.doLast(new Action<Task>() {
@Override
public void execute(Task task) {
if (expectedOutputFile.exists() == false) {
throw new InvalidUserDataException(
"Building " + bwcVersion.get() + " didn't generate expected artifact " + expectedOutputFile
);
}
}
});

});
bwcTaskProvider.configure(t -> t.dependsOn(bwcTaskName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.artifacts.dsl.DependencyHandler;
import org.gradle.api.plugins.BasePluginConvention;
import org.gradle.api.plugins.BasePluginExtension;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.provider.ProviderFactory;
Expand Down Expand Up @@ -50,10 +50,10 @@ public void registerTestArtifactFromSourceSet(SourceSet sourceSet) {
// PolicyUtil doesn't handle classifier notation well probably.
// Instead of fixing PoliceUtil we stick to the pattern of changing
// the basename here to indicate its a test artifacts jar.
BasePluginConvention convention = (BasePluginConvention) project.getConvention().getPlugins().get("base");
BasePluginExtension pluginExtension = project.getExtensions().getByType(BasePluginExtension.class);
project.getTasks().named(name + "Jar", Jar.class).configure(jar -> {
jar.getArchiveBaseName()
.convention(providerFactory.provider(() -> convention.getArchivesBaseName() + "-" + name + "-artifacts"));
.convention(providerFactory.provider(() -> pluginExtension.getArchivesName().get() + "-" + name + "-artifacts"));
jar.getArchiveClassifier().set("");
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ public void apply(Project project) {

TaskProvider<Task> preProcessFixture = project.getTasks().register("preProcessFixture", t -> {
t.getOutputs().dir(testfixturesDir);
t.doFirst(t2 -> {
try {
Files.createDirectories(testfixturesDir.toPath());
} catch (IOException e) {
throw new UncheckedIOException(e);
t.doFirst(new Action<Task>() {
@Override
public void execute(Task task) {
try {
Files.createDirectories(testfixturesDir.toPath());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.1
7.2
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=9bb8bc05f562f2d42bdf1ba8db62f6b6fa1c3bf6c392228802cc7cb0578fe7e0
distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b
Loading