Skip to content

Commit

Permalink
Update to Gradle 8.5 (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
reta committed Feb 6, 2024
1 parent 70222ba commit 344cae1
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 36 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/gauntlet-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ jobs:
build_rca_pkg:
runs-on: [ubuntu-latest]
name: Build and Run Gauntlet tests
strategy:
matrix:
java:
- 17
steps:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 14
java-version: ${{matrix.java}}
# RCA in ./tmp/performance-analyzer-rca
- name: Checkout RCA
uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
strategy:
matrix:
java:
- 11
- 17
fail-fast: false
runs-on: [ubuntu-latest]
Expand Down
43 changes: 22 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ plugins {
id 'java'
id 'application'
id 'maven-publish'
id 'com.google.protobuf' version '0.8.18'
id 'com.google.protobuf' version '0.9.4'
id 'jacoco'
id 'idea'
id 'com.github.spotbugs' version '5.0.13'
id "de.undercouch.download" version "4.0.4"
id 'com.adarshr.test-logger' version '2.1.0'
id 'org.gradle.test-retry' version '1.5.2'
id 'eclipse'
id 'com.github.spotbugs' version '6.0.7'
id "de.undercouch.download" version "5.5.0"
id 'com.adarshr.test-logger' version '4.0.0'
id 'org.gradle.test-retry' version '1.5.8'
id 'com.diffplug.spotless' version '5.11.0'
}

Expand Down Expand Up @@ -126,7 +127,8 @@ testlogger {

spotbugsMain {
excludeFilter = file("checkstyle/findbugs-exclude.xml")
effort = 'max'

effort = com.github.spotbugs.snom.Effort.MAX
ignoreFailures = true // TODO: Set this to false later as they are too many warnings to be fixed.

reports {
Expand All @@ -145,14 +147,14 @@ check {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.11"
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled false
xml.required = true
html.required = true
csv.required = false
}

afterEvaluate {
Expand Down Expand Up @@ -208,7 +210,7 @@ check.dependsOn jacocoTestCoverageVerification
version = opensearch_build

distZip {
archiveName "performance-analyzer-rca-${version}.zip"
archiveFileName = "performance-analyzer-rca-${version}.zip"
}

publishing {
Expand Down Expand Up @@ -260,6 +262,9 @@ tasks.withType(Test) {
jvmArgs('--add-opens=java.base/java.nio.file=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.lang=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.util=ALL-UNNAMED')
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
jvmArgs += ["-Djava.security.manager=allow"]
}
}

task rcaTest(type: Test) {
Expand Down Expand Up @@ -367,30 +372,26 @@ dependencies {
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: "${protobufVersion}"
implementation 'io.grpc:grpc-netty:1.56.1'
implementation 'io.grpc:grpc-protobuf:1.56.1'
implementation("io.netty:netty-codec-http2:${nettyVersion}") {
force = 'true'
}
implementation("io.netty:netty-handler-proxy:${nettyVersion}") {
force = 'true'
}
implementation("io.netty:netty-codec-http2:${nettyVersion}")
implementation("io.netty:netty-handler-proxy:${nettyVersion}")
implementation 'io.grpc:grpc-stub:1.52.1'
implementation "jakarta.annotation:jakarta.annotation-api:${jakartaVersion}"

// JDK9+ has to run powermock 2+. https://github.com/powermock/powermock/issues/888
testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.0'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.0'
implementation("org.mockito:mockito-core") {
testImplementation("org.mockito:mockito-core") {
version {
strictly "2.23.0"
}
}
testImplementation group: 'org.powermock', name: 'powermock-core', version: '2.0.2'
testImplementation group: 'org.powermock', name: 'powermock-api-support', version: '2.0.2'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4-common', version: '2.0.2'
testImplementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA'
testImplementation group: 'org.powermock', name: 'powermock-reflect', version: '2.0.2'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.9.3'
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.0.1'
testImplementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.14.7'
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.2'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1'
testImplementation group: 'junit', name: 'junit', version: "${junitVersion}"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down

0 comments on commit 344cae1

Please sign in to comment.