Skip to content

Commit

Permalink
Update to Gradle 8.4 (#2433) (#2480)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6f30aea)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta authored Jan 25, 2024
1 parent 894639a commit bad7703
Show file tree
Hide file tree
Showing 39 changed files with 227 additions and 218 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integ-tests-with-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 11, 17 ]
java: [ 11, 17, 21 ]

runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]
java: [ 11, 17 ]
java: [ 11, 17, 21 ]

runs-on: ${{ matrix.os }}

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
java:
- 11
- 17
- 21
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
Expand Down Expand Up @@ -105,6 +106,8 @@ jobs:
- { os: macos-latest, java: 11}
- { os: windows-latest, java: 17, os_build_args: -x doctest -PbuildPlatform=windows }
- { os: macos-latest, java: 17 }
- { os: windows-latest, java: 21, os_build_args: -x doctest -PbuildPlatform=windows }
- { os: macos-latest, java: 21 }
runs-on: ${{ matrix.entry.os }}

steps:
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ buildscript {
}

plugins {
id 'nebula.ospackage' version "8.3.0"
id "com.netflix.nebula.ospackage-base" version "11.5.0"
id 'java-library'
id "io.freefair.lombok" version "6.4.0"
id "io.freefair.lombok" version "8.4"
id 'jacoco'
id 'com.diffplug.spotless' version '6.19.0'
id 'com.diffplug.spotless' version '6.22.0'
}

// import versions defined in https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchJavaPlugin.java#L94
Expand Down Expand Up @@ -97,7 +97,7 @@ spotless {
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
googleJavaFormat('1.19.2').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
}
}

Expand All @@ -118,6 +118,7 @@ allprojects {
resolutionStrategy.force "com.squareup.okio:okio:3.5.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib:1.9.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
}
}

Expand Down Expand Up @@ -157,8 +158,8 @@ jacoco {
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
xml.required = false
csv.required = false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
9 changes: 5 additions & 4 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
plugins {
id 'java-library'
id "io.freefair.lombok"
id 'com.diffplug.spotless' version '6.22.0'
}

repositories {
Expand All @@ -46,10 +47,10 @@ dependencies {
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testImplementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.9.3'
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0'
testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.12.0'
}


Expand Down
12 changes: 6 additions & 6 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugins {
id "io.freefair.lombok"
id 'jacoco'
id 'java-test-fixtures'
id 'com.diffplug.spotless' version '6.22.0'
}

repositories {
Expand All @@ -44,11 +45,10 @@ dependencies {
api group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
api project(':common')

testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0'
}

test {
Expand All @@ -61,8 +61,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required = true
xml.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class LogicalPlanNodeVisitorTest {
static Table table;

@BeforeAll
private static void initMocks() {
public static void initMocks() {
expression = mock(Expression.class);
ref = mock(ReferenceExpression.class);
aggregator = mock(Aggregator.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class DataSourceTableScanTest {
private DataSourceTableScan dataSourceTableScan;

@BeforeEach
private void setUp() {
public void setUp() {
dataSourceTableScan = new DataSourceTableScan(dataSourceService);
}

Expand Down
14 changes: 7 additions & 7 deletions datasources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ dependencies {
implementation group: 'commons-validator', name: 'commons-validator', version: '1.7'

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.12.13'
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.14.9'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.2.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
}

test {
Expand All @@ -44,8 +44,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required = true
xml.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
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.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
42 changes: 19 additions & 23 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#!/usr/bin/env sh
#
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
#
Expand Down Expand Up @@ -92,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 @@ -142,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 @@ -206,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
Loading

0 comments on commit bad7703

Please sign in to comment.