From b657789d8ac64be227c971f8c5679c76b286a309 Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Tue, 15 Mar 2022 13:15:34 -0500 Subject: [PATCH] Downgrade Gradle version (#1661) * Downgrade gradle version BWC tooling is built with gradle 6, which has breaking changes that are not compatiable with gradle 7. In order to support BWC tests we need to align with the OpenSearch's gradle version for the 1.3 release. See Also: * Gradle 7 PR in OpenSearch https://github.com/opensearch-project/OpenSearch/pull/1622 * Distribution build bugs encountered by plugins https://github.com/opensearch-project/opensearch-build/issues/1247 * Revert of Gradle 7 PR in OpenSearch https://github.com/opensearch-project/OpenSearch/pull/1657 Signed-off-by: Peter Nied --- .github/workflows/ci.yml | 12 ++++++++++-- build.gradle | 24 ++++++++++++++++++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 831322fa13..78b5977e5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,19 @@ jobs: steps: - - name: Set up JDK + - name: Set up JDK for build and test + if: matrix.jdk != 17 uses: actions/setup-java@v1 with: java-version: ${{ matrix.jdk }} + - name: Set up build for JDK17 to use JKD11 + if: matrix.jdk == 17 + uses: actions/setup-java@v2 + with: + distribution: temurin # Temurin is a distribution of adoptium + java-version: 11 + - name: Checkout security uses: actions/checkout@v2 @@ -39,7 +47,7 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Package + - name: Run Tests run: ./gradlew clean build -Dbuild.snapshot=false -x test - name: Perform CodeQL Analysis diff --git a/build.gradle b/build.gradle index 83ba4e00f3..7ae51d0c2b 100644 --- a/build.gradle +++ b/build.gradle @@ -224,6 +224,21 @@ test { maxFailures = 30 maxRetries = 5 } + jacoco { + excludes = [ + "com.sun.jndi.dns.*", + "com.sun.security.sasl.gsskerb.*", + "java.sql.*", + "javax.script.*", + "org.jcp.xml.dsig.internal.dom.*", + "sun.nio.cs.ext.*", + "sun.security.ec.*", + "sun.security.jgss.*", + "sun.security.pkcs11.*", + "sun.security.smartcardio.*", + "sun.util.resources.provider.*" + ] + } } gitProperties { @@ -246,16 +261,17 @@ gitProperties { } // copied from: org.opensearch.gradle.dependencies.CompileOnlyResolvePlugin -project.getConfigurations().all(configuration -> { +project.getConfigurations().all { Configuration configuration -> if (configuration.getName().equals(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME)) { NamedDomainObjectProvider resolvableCompileOnly = project.getConfigurations().register('resolveableCompileOnly'); - resolvableCompileOnly.configure((c) -> { + resolvableCompileOnly.configure { c -> c.setCanBeResolved(true); c.setCanBeConsumed(false); c.extendsFrom(configuration); - }); + }; } -}); +}; + task bundle(dependsOn: jar, type: Zip) { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e09..549d84424d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists