Skip to content

Commit 6f30aea

Browse files
authored
Update to Gradle 8.4 (opensearch-project#2433)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
1 parent efb159a commit 6f30aea

38 files changed

+128
-132
lines changed

build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ buildscript {
6363
}
6464

6565
plugins {
66-
id 'nebula.ospackage' version "8.3.0"
66+
id "com.netflix.nebula.ospackage-base" version "11.5.0"
6767
id 'java-library'
68-
id "io.freefair.lombok" version "6.4.0"
68+
id "io.freefair.lombok" version "8.4"
6969
id 'jacoco'
70-
id 'com.diffplug.spotless' version '6.19.0'
70+
id 'com.diffplug.spotless' version '6.22.0'
7171
}
7272

7373
// import versions defined in https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchJavaPlugin.java#L94
@@ -155,8 +155,8 @@ jacoco {
155155
}
156156
jacocoTestReport {
157157
reports {
158-
xml.enabled false
159-
csv.enabled false
158+
xml.required = false
159+
csv.required = false
160160
}
161161
afterEvaluate {
162162
classDirectories.setFrom(files(classDirectories.files.collect {

common/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
plugins {
2626
id 'java-library'
2727
id "io.freefair.lombok"
28-
id 'com.diffplug.spotless' version '6.19.0'
28+
id 'com.diffplug.spotless' version '6.22.0'
2929
}
3030

3131
repositories {
@@ -47,9 +47,9 @@ dependencies {
4747
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
4848
testImplementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
4949
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
50-
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
51-
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4'
52-
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
50+
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
51+
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
52+
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0'
5353
testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.12.0'
5454
}
5555

core/build.gradle

+6-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ plugins {
2828
id 'jacoco'
2929
id 'info.solidsoft.pitest' version '1.9.0'
3030
id 'java-test-fixtures'
31-
id 'com.diffplug.spotless' version '6.19.0'
31+
id 'com.diffplug.spotless' version '6.22.0'
3232

3333
}
3434

@@ -56,11 +56,10 @@ dependencies {
5656
api group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
5757
api project(':common')
5858

59-
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
59+
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
6060
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
61-
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4'
62-
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '3.12.4'
63-
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
61+
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
62+
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0'
6463
}
6564

6665
spotless {
@@ -91,8 +90,8 @@ test {
9190

9291
jacocoTestReport {
9392
reports {
94-
html.enabled true
95-
xml.enabled true
93+
html.required = true
94+
xml.required = true
9695
}
9796
afterEvaluate {
9897
classDirectories.setFrom(files(classDirectories.files.collect {

core/src/test/java/org/opensearch/sql/planner/logical/LogicalPlanNodeVisitorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class LogicalPlanNodeVisitorTest {
5353
static Table table;
5454

5555
@BeforeAll
56-
private static void initMocks() {
56+
public static void initMocks() {
5757
expression = mock(Expression.class);
5858
ref = mock(ReferenceExpression.class);
5959
aggregator = mock(Aggregator.class);

core/src/test/java/org/opensearch/sql/planner/physical/datasource/DataSourceTableScanTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class DataSourceTableScanTest {
4343
private DataSourceTableScan dataSourceTableScan;
4444

4545
@BeforeEach
46-
private void setUp() {
46+
public void setUp() {
4747
dataSourceTableScan = new DataSourceTableScan(dataSourceService);
4848
}
4949

datasources/build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ dependencies {
2626
implementation group: 'commons-validator', name: 'commons-validator', version: '1.7'
2727

2828
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
29-
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
30-
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.12.13'
29+
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')
30+
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.14.9'
3131
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
32-
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.2.0'
33-
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.2.0'
34-
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
32+
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
33+
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0'
34+
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
3535
}
3636

3737
test {
@@ -44,8 +44,8 @@ test {
4444

4545
jacocoTestReport {
4646
reports {
47-
html.enabled true
48-
xml.enabled true
47+
html.required = true
48+
xml.required = true
4949
}
5050
afterEvaluate {
5151
classDirectories.setFrom(files(classDirectories.files.collect {

doctest/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
id 'base'
1010
id 'com.wiredforcode.spawn'
1111
id "de.undercouch.download" version "5.3.0"
12-
id 'com.diffplug.spotless' version '6.19.0'
12+
id 'com.diffplug.spotless' version '6.22.0'
1313
}
1414

1515
apply plugin: 'opensearch.testclusters'
@@ -24,7 +24,7 @@ task cloneSqlCli(type: Exec) {
2424
commandLine 'git', 'clone', 'https://github.com/opensearch-project/sql-cli.git'
2525
}
2626

27-
task bootstrap(type: Exec, dependsOn: ['cloneSqlCli']) {
27+
task bootstrap(type: Exec, dependsOn: ['cloneSqlCli', 'spotlessJava']) {
2828
inputs.file "$projectDir/bootstrap.sh"
2929
outputs.dir "$projectDir/.venv"
3030

gradle/wrapper/gradle-wrapper.jar

2.1 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33
distributionBase=GRADLE_USER_HOME
44
distributionPath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
66
networkTimeout=10000
77
zipStoreBase=GRADLE_USER_HOME
88
zipStorePath=wrapper/dists
9+
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae

gradlew

+19-23
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
#!/usr/bin/env sh
2-
#
3-
# Copyright OpenSearch Contributors
4-
# SPDX-License-Identifier: Apache-2.0
5-
#
6-
# The OpenSearch Contributors require contributions made to
7-
# this file be licensed under the Apache-2.0 license or a
8-
# compatible open source license.
9-
#
10-
# Modifications Copyright OpenSearch Contributors. See
11-
# GitHub history for details.
1+
#!/bin/sh
2+
123
#
134
# Copyright © 2015-2021 the original authors.
145
#
@@ -92,10 +83,8 @@ done
9283
# This is normally unused
9384
# shellcheck disable=SC2034
9485
APP_BASE_NAME=${0##*/}
95-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
96-
97-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
98-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9988

10089
# Use the maximum available, or set MAX_FD != -1 to use that value.
10190
MAX_FD=maximum
@@ -142,26 +131,29 @@ location of your Java installation."
142131
fi
143132
else
144133
JAVACMD=java
145-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
146137
147138
Please set the JAVA_HOME variable in your environment to match the
148139
location of your Java installation."
140+
fi
149141
fi
150142

151143
# Increase the maximum file descriptors if we can.
152144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
153145
case $MAX_FD in #(
154146
max*)
155147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
157149
MAX_FD=$( ulimit -H -n ) ||
158150
warn "Could not query maximum file descriptor limit"
159151
esac
160152
case $MAX_FD in #(
161153
'' | soft) :;; #(
162154
*)
163155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
164-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
165157
ulimit -n "$MAX_FD" ||
166158
warn "Could not set maximum file descriptor limit to $MAX_FD"
167159
esac
@@ -206,11 +198,15 @@ if "$cygwin" || "$msys" ; then
206198
done
207199
fi
208200

209-
# Collect all arguments for the java command;
210-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
211-
# shell script including quotes and variable substitutions, so put them in
212-
# double quotes to make sure that they get re-expanded; and
213-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
214210

215211
set -- \
216212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
@rem
2-
@rem Copyright OpenSearch Contributors
3-
@rem SPDX-License-Identifier: Apache-2.0
4-
@rem
5-
@rem The OpenSearch Contributors require contributions made to
6-
@rem this file be licensed under the Apache-2.0 license or a
7-
@rem compatible open source license.
8-
@rem
9-
@rem Modifications Copyright OpenSearch Contributors. See
10-
@rem GitHub history for details.
11-
@rem
122
@rem Copyright 2015 the original author or authors.
133
@rem
144
@rem Licensed under the Apache License, Version 2.0 (the "License");

integ-test/build.gradle

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import org.opensearch.gradle.test.RestIntegTestTask
2626
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
2727
import org.opensearch.gradle.testclusters.OpenSearchCluster
28+
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
29+
import org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestFramework
2830

2931
import groovy.xml.XmlParser
3032
import java.nio.file.Paths
@@ -33,7 +35,7 @@ import java.util.stream.Collectors
3335

3436
plugins {
3537
id "de.undercouch.download" version "5.3.0"
36-
id 'com.diffplug.spotless' version '6.19.0'
38+
id 'com.diffplug.spotless' version '6.22.0'
3739
}
3840

3941
apply plugin: 'opensearch.build'
@@ -179,8 +181,9 @@ dependencies {
179181
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version:"${versions.log4j}"
180182
testImplementation project(':opensearch-sql-plugin')
181183
testImplementation project(':legacy')
182-
testImplementation('org.junit.jupiter:junit-jupiter-api:5.6.2')
183-
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.6.2')
184+
testImplementation('org.junit.jupiter:junit-jupiter-api:5.9.3')
185+
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.9.3')
186+
testRuntimeOnly('org.junit.platform:junit-platform-launcher:1.9.3')
184187

185188
testImplementation group: 'com.h2database', name: 'h2', version: '2.2.220'
186189
testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.41.2.2'

legacy/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ plugins {
2626
id 'java'
2727
id 'io.freefair.lombok'
2828
id 'antlr'
29-
id 'com.diffplug.spotless' version '6.19.0'
29+
id 'com.diffplug.spotless' version '6.22.0'
3030
}
3131

3232
generateGrammarSource {
@@ -123,7 +123,7 @@ dependencies {
123123
compileOnly group: 'javax.servlet', name: 'servlet-api', version:'2.5'
124124

125125
testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2'
126-
testImplementation group: 'org.mockito', name: 'mockito-inline', version:'3.12.4'
126+
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
127127
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
128128

129129
}

legacy/src/test/java/org/opensearch/sql/legacy/unittest/JSONRequestTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import static org.hamcrest.MatcherAssert.assertThat;
99
import static org.hamcrest.Matchers.containsString;
1010
import static org.hamcrest.Matchers.equalTo;
11-
import static org.mockito.Matchers.any;
12-
import static org.mockito.Matchers.anyInt;
11+
import static org.mockito.ArgumentMatchers.any;
12+
import static org.mockito.ArgumentMatchers.anyInt;
1313
import static org.mockito.Mockito.mock;
1414
import static org.mockito.Mockito.when;
1515

legacy/src/test/java/org/opensearch/sql/legacy/unittest/LocalClusterStateTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
package org.opensearch.sql.legacy.unittest;
77

88
import static org.junit.Assert.assertEquals;
9-
import static org.mockito.Matchers.any;
10-
import static org.mockito.Matchers.eq;
9+
import static org.mockito.ArgumentMatchers.any;
10+
import static org.mockito.ArgumentMatchers.eq;
1111
import static org.mockito.Mockito.doAnswer;
1212
import static org.mockito.Mockito.mock;
1313
import static org.mockito.Mockito.times;

legacy/src/test/java/org/opensearch/sql/legacy/unittest/OpenSearchClientTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package org.opensearch.sql.legacy.unittest;
77

8-
import static org.mockito.Matchers.any;
8+
import static org.mockito.ArgumentMatchers.any;
99
import static org.mockito.Mockito.mock;
1010
import static org.mockito.Mockito.when;
1111

legacy/src/test/java/org/opensearch/sql/legacy/unittest/SqlRequestFactoryTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.junit.runner.RunWith;
1616
import org.mockito.Mock;
1717
import org.mockito.Mockito;
18-
import org.mockito.runners.MockitoJUnitRunner;
18+
import org.mockito.junit.MockitoJUnitRunner;
1919
import org.opensearch.core.common.bytes.BytesArray;
2020
import org.opensearch.rest.RestRequest;
2121
import org.opensearch.sql.legacy.esdomain.LocalClusterState;

legacy/src/test/java/org/opensearch/sql/legacy/unittest/executor/join/ElasticUtilsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.junit.Test;
1414
import org.junit.runner.RunWith;
1515
import org.mockito.Mock;
16-
import org.mockito.runners.MockitoJUnitRunner;
16+
import org.mockito.junit.MockitoJUnitRunner;
1717
import org.opensearch.search.SearchHit;
1818
import org.opensearch.search.SearchHits;
1919
import org.opensearch.sql.legacy.executor.join.ElasticUtils;

legacy/src/test/java/org/opensearch/sql/legacy/unittest/expression/core/BinaryExpressionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.junit.Test;
1616
import org.junit.rules.ExpectedException;
1717
import org.junit.runner.RunWith;
18-
import org.mockito.runners.MockitoJUnitRunner;
18+
import org.mockito.junit.MockitoJUnitRunner;
1919
import org.opensearch.sql.legacy.expression.core.operator.ScalarOperation;
2020

2121
@RunWith(MockitoJUnitRunner.class)

legacy/src/test/java/org/opensearch/sql/legacy/unittest/expression/core/UnaryExpressionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.junit.Test;
1515
import org.junit.rules.ExpectedException;
1616
import org.junit.runner.RunWith;
17-
import org.mockito.runners.MockitoJUnitRunner;
17+
import org.mockito.junit.MockitoJUnitRunner;
1818
import org.opensearch.sql.legacy.expression.core.operator.ScalarOperation;
1919

2020
@RunWith(MockitoJUnitRunner.class)

legacy/src/test/java/org/opensearch/sql/legacy/unittest/expression/model/ExprValueUtilsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.junit.Test;
1313
import org.junit.rules.ExpectedException;
1414
import org.junit.runner.RunWith;
15-
import org.mockito.runners.MockitoJUnitRunner;
15+
import org.mockito.junit.MockitoJUnitRunner;
1616
import org.opensearch.sql.legacy.expression.model.ExprValueFactory;
1717
import org.opensearch.sql.legacy.expression.model.ExprValueUtils;
1818

legacy/src/test/java/org/opensearch/sql/legacy/unittest/metrics/RollingCounterTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.junit.Test;
1515
import org.junit.runner.RunWith;
1616
import org.mockito.Mock;
17-
import org.mockito.runners.MockitoJUnitRunner;
17+
import org.mockito.junit.MockitoJUnitRunner;
1818
import org.opensearch.sql.legacy.metrics.RollingCounter;
1919

2020
@RunWith(MockitoJUnitRunner.class)

0 commit comments

Comments
 (0)