mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
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:
parent
c1e9590a69
commit
c2e86258d8
13 changed files with 19 additions and 23 deletions
|
@ -48,7 +48,7 @@ public class ElasticsearchTestBasePlugin implements Plugin<Project> {
|
||||||
File heapdumpDir = new File(project.getBuildDir(), "heapdump");
|
File heapdumpDir = new File(project.getBuildDir(), "heapdump");
|
||||||
|
|
||||||
project.getTasks().withType(Test.class).configureEach(test -> {
|
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);
|
ErrorReportingTestListener listener = new ErrorReportingTestListener(test.getTestLogging(), test.getLogger(), testOutputDir);
|
||||||
test.getExtensions().add("errorReportingTestListener", listener);
|
test.getExtensions().add("errorReportingTestListener", listener);
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class CheckstylePrecommitPlugin extends PrecommitPlugin implements Intern
|
||||||
|
|
||||||
project.getTasks().withType(Checkstyle.class).configureEach(t -> {
|
project.getTasks().withType(Checkstyle.class).configureEach(t -> {
|
||||||
t.dependsOn(copyCheckstyleConf);
|
t.dependsOn(copyCheckstyleConf);
|
||||||
t.reports(r -> r.getHtml().setEnabled(false));
|
t.reports(r -> r.getHtml().getRequired().set(false));
|
||||||
});
|
});
|
||||||
|
|
||||||
return checkstyleTask;
|
return checkstyleTask;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.elasticsearch.gradle.LoggedExec;
|
||||||
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitTask;
|
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitTask;
|
||||||
import org.gradle.api.file.FileCollection;
|
import org.gradle.api.file.FileCollection;
|
||||||
import org.gradle.api.plugins.JavaPluginConvention;
|
import org.gradle.api.plugins.JavaPluginConvention;
|
||||||
|
import org.gradle.api.plugins.JavaPluginExtension;
|
||||||
import org.gradle.api.tasks.CacheableTask;
|
import org.gradle.api.tasks.CacheableTask;
|
||||||
import org.gradle.api.tasks.Classpath;
|
import org.gradle.api.tasks.Classpath;
|
||||||
import org.gradle.api.tasks.InputFiles;
|
import org.gradle.api.tasks.InputFiles;
|
||||||
|
@ -43,7 +44,7 @@ public class LoggerUsageTask extends PrecommitTask {
|
||||||
@TaskAction
|
@TaskAction
|
||||||
public void runLoggerUsageTask() {
|
public void runLoggerUsageTask() {
|
||||||
LoggedExec.javaexec(execOperations, spec -> {
|
LoggedExec.javaexec(execOperations, spec -> {
|
||||||
spec.setMain("org.elasticsearch.test.loggerusage.ESLoggerUsageChecker");
|
spec.getMainClass().set("org.elasticsearch.test.loggerusage.ESLoggerUsageChecker");
|
||||||
spec.classpath(getClasspath());
|
spec.classpath(getClasspath());
|
||||||
getClassDirectories().forEach(spec::args);
|
getClassDirectories().forEach(spec::args);
|
||||||
});
|
});
|
||||||
|
@ -62,8 +63,7 @@ public class LoggerUsageTask extends PrecommitTask {
|
||||||
@PathSensitive(PathSensitivity.RELATIVE)
|
@PathSensitive(PathSensitivity.RELATIVE)
|
||||||
@SkipWhenEmpty
|
@SkipWhenEmpty
|
||||||
public FileCollection getClassDirectories() {
|
public FileCollection getClassDirectories() {
|
||||||
return getProject().getConvention()
|
return getProject().getExtensions().getByType(JavaPluginExtension.class)
|
||||||
.getPlugin(JavaPluginConvention.class)
|
|
||||||
.getSourceSets()
|
.getSourceSets()
|
||||||
.stream()
|
.stream()
|
||||||
// Don't pick up all source sets like the java9 ones as logger-check doesn't support the class format
|
// Don't pick up all source sets like the java9 ones as logger-check doesn't support the class format
|
||||||
|
|
|
@ -334,7 +334,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
|
||||||
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
|
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
|
||||||
);
|
);
|
||||||
spec.jvmArgs("-Xmx1g");
|
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.args("-f", getSignatureFile().getAbsolutePath(), "-d", getJarExpandDir(), "--allowmissingclasses");
|
||||||
spec.setErrorOutput(errorOut);
|
spec.setErrorOutput(errorOut);
|
||||||
if (getLogger().isInfoEnabled() == false) {
|
if (getLogger().isInfoEnabled() == false) {
|
||||||
|
@ -364,7 +364,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
|
||||||
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
|
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.args(getJarExpandDir());
|
||||||
spec.setIgnoreExitValue(true);
|
spec.setIgnoreExitValue(true);
|
||||||
if (javaHome != null) {
|
if (javaHome != null) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7.0.2
|
7.1
|
|
@ -55,7 +55,8 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
|
||||||
doLast(new Action<Task>() {
|
doLast(new Action<Task>() {
|
||||||
@Override
|
@Override
|
||||||
public void execute(Task task) {
|
public void execute(Task task) {
|
||||||
if (LoggedExec.this.getExecResult().getExitValue() != 0) {
|
int exitValue = LoggedExec.this.getExecutionResult().get().getExitValue();
|
||||||
|
if (exitValue != 0) {
|
||||||
try {
|
try {
|
||||||
LoggedExec.this.getLogger().error("Output for " + LoggedExec.this.getExecutable() + ":");
|
LoggedExec.this.getLogger().error("Output for " + LoggedExec.this.getExecutable() + ":");
|
||||||
outputLogger.accept(LoggedExec.this.getLogger());
|
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",
|
"Process '%s %s' finished with non-zero exit value %d",
|
||||||
LoggedExec.this.getExecutable(),
|
LoggedExec.this.getExecutable(),
|
||||||
LoggedExec.this.getArgs(),
|
LoggedExec.this.getArgs(),
|
||||||
LoggedExec.this.getExecResult().getExitValue()
|
exitValue
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class JarHellTask extends DefaultTask {
|
||||||
public void runJarHellCheck() throws IOException{
|
public void runJarHellCheck() throws IOException{
|
||||||
LoggedExec.javaexec(execOperations, spec -> {
|
LoggedExec.javaexec(execOperations, spec -> {
|
||||||
spec.environment("CLASSPATH", getJarHellRuntimeClasspath().plus(getClasspath()).getAsPath());
|
spec.environment("CLASSPATH", getJarHellRuntimeClasspath().plus(getClasspath()).getAsPath());
|
||||||
spec.setMain("org.elasticsearch.jdk.JarHell");
|
spec.getMainClass().set("org.elasticsearch.jdk.JarHell");
|
||||||
});
|
});
|
||||||
writeMarker();
|
writeMarker();
|
||||||
}
|
}
|
||||||
|
|
|
@ -345,7 +345,7 @@ tasks.named("wrapper").configure {
|
||||||
println "Added checksum to wrapper properties"
|
println "Added checksum to wrapper properties"
|
||||||
// Update build-tools to reflect the Gradle upgrade
|
// Update build-tools to reflect the Gradle upgrade
|
||||||
// TODO: we can remove this once we have tests to make sure older versions work.
|
// 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"
|
println "Updated minimum Gradle Version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ buildscript {
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
dependencies {
|
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 jdkString = jdk ? "" : "no-jdk-"
|
||||||
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||||
destinationDirectory = file("${prefix}/build/distributions")
|
destinationDirectory = file("${prefix}/build/distributions")
|
||||||
|
archiveFileName.value(project.provider({ "${packageName}-${project.version}-${jdkString}${archString}.${type}" } ))
|
||||||
// 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}")) }
|
|
||||||
|
|
||||||
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||||
|
|
||||||
String scripts = "${packagingFiles}/scripts"
|
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
|
// this is package indepdendent configuration
|
||||||
ospackage {
|
ospackage {
|
||||||
maintainer 'Elasticsearch Team <info@elastic.co>'
|
maintainer 'Elasticsearch Team <info@elastic.co>'
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionSha256Sum=13bf8d3cf8eeeb5770d19741a59bde9bd966dd78d17f1bbad787a05ef19d1c2d
|
distributionSha256Sum=a9e356a21595348b6f04b024ed0b08ac8aea6b2ac37e6c0ef58e51549cd7b9cb
|
||||||
|
|
2
gradlew
vendored
2
gradlew
vendored
|
@ -72,7 +72,7 @@ case "`uname`" in
|
||||||
Darwin* )
|
Darwin* )
|
||||||
darwin=true
|
darwin=true
|
||||||
;;
|
;;
|
||||||
MINGW* )
|
MSYS* | MINGW* )
|
||||||
msys=true
|
msys=true
|
||||||
;;
|
;;
|
||||||
NONSTOP* )
|
NONSTOP* )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.5.1"
|
id "com.gradle.enterprise" version "3.6.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
includeBuild "build-conventions"
|
includeBuild "build-conventions"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue