diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index 2d2ec788fa7..db62e909502 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -8,3 +8,6 @@ ES_BUILD_JAVA=openjdk12 ES_RUNTIME_JAVA=java8 GRADLE_TASK=build GRADLE_EXTRA_ARGS= + +# Workaround for https://github.com/gradle/gradle/issues/11426 +OPENSHIFT_IP=0.0.0.0 diff --git a/build.gradle b/build.gradle index 9ff54f42512..7e08f2cbf4b 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,6 @@ import org.gradle.util.GradleVersion import static org.elasticsearch.gradle.tool.Boilerplate.maybeConfigure plugins { - id 'com.gradle.build-scan' version '2.4.2' id 'lifecycle-base' id 'elasticsearch.global-build-info' id "com.diffplug.gradle.spotless" version "3.24.2" apply false diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 0c62654c720..3b8efccf434 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -29,7 +29,7 @@ group = 'org.elasticsearch.gradle' String minimumGradleVersion = file('src/main/resources/minimumGradleVersion').text.trim() if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) { - throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch") + throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch") } if (project == rootProject) { diff --git a/buildSrc/src/main/resources/minimumGradleVersion b/buildSrc/src/main/resources/minimumGradleVersion index 2a06a418a77..6d54bbd7751 100644 --- a/buildSrc/src/main/resources/minimumGradleVersion +++ b/buildSrc/src/main/resources/minimumGradleVersion @@ -1 +1 @@ -5.6.4 \ No newline at end of file +6.0.1 \ No newline at end of file diff --git a/buildSrc/src/testKit/thirdPartyAudit/build.gradle b/buildSrc/src/testKit/thirdPartyAudit/build.gradle index 253d3f0acc1..629460c2627 100644 --- a/buildSrc/src/testKit/thirdPartyAudit/build.gradle +++ b/buildSrc/src/testKit/thirdPartyAudit/build.gradle @@ -16,6 +16,9 @@ repositories { maven { name = "local-test" url = file("sample_jars/build/testrepo") + metadataSources { + artifact() + } } jcenter() } diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 695654bca34..99de6773c0f 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -51,16 +51,8 @@ import java.util.regex.Pattern * dpkg -c path/to/elasticsearch.deb */ -buildscript { - repositories { - maven { - name "gradle-plugins" - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath 'com.netflix.nebula:gradle-ospackage-plugin:4.7.1' - } +plugins { + id "nebula.ospackage-base" version "8.0.3" } void addProcessFilesTask(String type, boolean oss, boolean jdk) { @@ -115,10 +107,12 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { arch(type == 'deb' ? 'amd64' : 'X86_64') // Follow elasticsearch's file naming convention String jdkString = jdk ? "" : "no-jdk-" - archiveName "${packageName}-${project.version}-${jdkString}${archString}.${type}" - String prefix = "${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" destinationDir = 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("${destinationDir}/${packageName}-${project.version}-${jdkString}${archString}.${type}")) } + String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" String scripts = "${packagingFiles}/scripts" @@ -157,7 +151,9 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { eachFile { FileCopyDetails fcp -> String[] segments = fcp.relativePath.segments for (int i = segments.length - 2; i > 2; --i) { - directory('/' + segments[0..i].join('/'), 0755) + if (type == 'rpm') { + directory('/' + segments[0..i].join('/'), 0755) + } if (segments[-2] == 'bin' || segments[-1] == 'jspawnhelper') { fcp.mode = 0755 } else { diff --git a/gradle/build-complete.gradle b/gradle/build-complete.gradle index 3ce58d19f53..32c7bc4b068 100644 --- a/gradle/build-complete.gradle +++ b/gradle/build-complete.gradle @@ -38,6 +38,8 @@ if (buildNumber) { fileset(dir: "${gradle.gradleUserHomeDir}/daemon/${gradle.gradleVersion}", followsymlinks: false) { include(name: "**/daemon-${ProcessHandle.current().pid()}*.log") } + + fileset(dir: "${gradle.gradleUserHomeDir}/workers", followsymlinks: false) } } catch (Exception e) { logger.lifecycle("Failed to archive additional logs", e) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016b..cc4fdc293d0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c71beb8ee5f..ba9078ad2ad 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionSha256Sum=abc10bcedb58806e8654210f96031db541bcd2d6fc3161e81cb0572d6a15e821 +distributionSha256Sum=6f6cfdbb12a577c3845522a1c7fbfe1295ea05d87edabedd4e23fd2bf02b88b1 diff --git a/gradlew b/gradlew index 83f2acfdc31..2fe81a7d95e 100755 --- a/gradlew +++ b/gradlew @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/settings.gradle b/settings.gradle index b23ce78e0fa..6dc9b1d2443 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,7 @@ +plugins { + id "com.gradle.enterprise" version "3.0" +} + String dirName = rootProject.projectDir.name rootProject.name = dirName