Update wrapper to 7.1 (#73941)

- Fix new introduced deprecated usages
- Update to newer ospackage snapshot to include provided PR for fixing deprecated usage

This gradle release comes with improvements on incremental compilation which we should benefit from
This commit is contained in:
Rene Groeschke 2021-06-17 10:59:22 +02:00 committed by GitHub
parent c1e9590a69
commit c2e86258d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 19 additions and 23 deletions

View file

@ -48,7 +48,7 @@ public class ElasticsearchTestBasePlugin implements Plugin<Project> {
File heapdumpDir = new File(project.getBuildDir(), "heapdump");
project.getTasks().withType(Test.class).configureEach(test -> {
File testOutputDir = new File(test.getReports().getJunitXml().getDestination(), "output");
File testOutputDir = new File(test.getReports().getJunitXml().getOutputLocation().getAsFile().get(), "output");
ErrorReportingTestListener listener = new ErrorReportingTestListener(test.getTestLogging(), test.getLogger(), testOutputDir);
test.getExtensions().add("errorReportingTestListener", listener);

View file

@ -94,7 +94,7 @@ public class CheckstylePrecommitPlugin extends PrecommitPlugin implements Intern
project.getTasks().withType(Checkstyle.class).configureEach(t -> {
t.dependsOn(copyCheckstyleConf);
t.reports(r -> r.getHtml().setEnabled(false));
t.reports(r -> r.getHtml().getRequired().set(false));
});
return checkstyleTask;

View file

@ -12,6 +12,7 @@ import org.elasticsearch.gradle.LoggedExec;
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitTask;
import org.gradle.api.file.FileCollection;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Classpath;
import org.gradle.api.tasks.InputFiles;
@ -43,7 +44,7 @@ public class LoggerUsageTask extends PrecommitTask {
@TaskAction
public void runLoggerUsageTask() {
LoggedExec.javaexec(execOperations, spec -> {
spec.setMain("org.elasticsearch.test.loggerusage.ESLoggerUsageChecker");
spec.getMainClass().set("org.elasticsearch.test.loggerusage.ESLoggerUsageChecker");
spec.classpath(getClasspath());
getClassDirectories().forEach(spec::args);
});
@ -62,8 +63,7 @@ public class LoggerUsageTask extends PrecommitTask {
@PathSensitive(PathSensitivity.RELATIVE)
@SkipWhenEmpty
public FileCollection getClassDirectories() {
return getProject().getConvention()
.getPlugin(JavaPluginConvention.class)
return getProject().getExtensions().getByType(JavaPluginExtension.class)
.getSourceSets()
.stream()
// Don't pick up all source sets like the java9 ones as logger-check doesn't support the class format

View file

@ -334,7 +334,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
);
spec.jvmArgs("-Xmx1g");
spec.setMain("de.thetaphi.forbiddenapis.cli.CliMain");
spec.getMainClass().set("de.thetaphi.forbiddenapis.cli.CliMain");
spec.args("-f", getSignatureFile().getAbsolutePath(), "-d", getJarExpandDir(), "--allowmissingclasses");
spec.setErrorOutput(errorOut);
if (getLogger().isInfoEnabled() == false) {
@ -364,7 +364,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
);
spec.setMain(JDK_JAR_HELL_MAIN_CLASS);
spec.getMainClass().set(JDK_JAR_HELL_MAIN_CLASS);
spec.args(getJarExpandDir());
spec.setIgnoreExitValue(true);
if (javaHome != null) {

View file

@ -55,7 +55,8 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
doLast(new Action<Task>() {
@Override
public void execute(Task task) {
if (LoggedExec.this.getExecResult().getExitValue() != 0) {
int exitValue = LoggedExec.this.getExecutionResult().get().getExitValue();
if (exitValue != 0) {
try {
LoggedExec.this.getLogger().error("Output for " + LoggedExec.this.getExecutable() + ":");
outputLogger.accept(LoggedExec.this.getLogger());
@ -67,7 +68,7 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
"Process '%s %s' finished with non-zero exit value %d",
LoggedExec.this.getExecutable(),
LoggedExec.this.getArgs(),
LoggedExec.this.getExecResult().getExitValue()
exitValue
)
);
}

View file

@ -54,7 +54,7 @@ public class JarHellTask extends DefaultTask {
public void runJarHellCheck() throws IOException{
LoggedExec.javaexec(execOperations, spec -> {
spec.environment("CLASSPATH", getJarHellRuntimeClasspath().plus(getClasspath()).getAsPath());
spec.setMain("org.elasticsearch.jdk.JarHell");
spec.getMainClass().set("org.elasticsearch.jdk.JarHell");
});
writeMarker();
}

View file

@ -345,7 +345,7 @@ tasks.named("wrapper").configure {
println "Added checksum to wrapper properties"
// Update build-tools to reflect the Gradle upgrade
// TODO: we can remove this once we have tests to make sure older versions work.
project(':build-tools').file('src/main/resources/minimumGradleVersion').text = gradleVersion
project.file('build-tools-internal/src/main/resources/minimumGradleVersion').text = gradleVersion
println "Updated minimum Gradle Version"
}
}

View file

@ -48,7 +48,7 @@ buildscript {
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.github.breskeby:gradle-ospackage-plugin:ddb72a9922b934033827d48d296f7f3d470ac422"
classpath "com.github.breskeby:gradle-ospackage-plugin:98455c1"
}
}
@ -124,10 +124,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
String jdkString = jdk ? "" : "no-jdk-"
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
destinationDirectory = file("${prefix}/build/distributions")
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-${project.version}-${jdkString}${archString}.${type}")) }
archiveFileName.value(project.provider({ "${packageName}-${project.version}-${jdkString}${archString}.${type}" } ))
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
String scripts = "${packagingFiles}/scripts"
@ -278,8 +275,6 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
}
}
apply plugin: 'nebula.ospackage-base'
// this is package indepdendent configuration
ospackage {
maintainer 'Elasticsearch Team <info@elastic.co>'

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=13bf8d3cf8eeeb5770d19741a59bde9bd966dd78d17f1bbad787a05ef19d1c2d
distributionSha256Sum=a9e356a21595348b6f04b024ed0b08ac8aea6b2ac37e6c0ef58e51549cd7b9cb

2
gradlew vendored
View file

@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )

View file

@ -1,5 +1,5 @@
plugins {
id "com.gradle.enterprise" version "3.5.1"
id "com.gradle.enterprise" version "3.6.2"
}
includeBuild "build-conventions"