Skip to content

Commit

Permalink
Downgrade Gradle version (opensearch-project#1661)
Browse files Browse the repository at this point in the history
* 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 opensearch-project/OpenSearch#1622
* Distribution build bugs encountered by plugins opensearch-project/opensearch-build#1247
* Revert of Gradle 7 PR in OpenSearch  opensearch-project/OpenSearch#1657

Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied authored Mar 15, 2022
1 parent b3ff6f2 commit b657789
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
24 changes: 20 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<Configuration> 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) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b657789

Please sign in to comment.