Skip to content

Commit

Permalink
Update to Gradle 8.4 (opensearch-project#2433)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta authored Jan 24, 2024
1 parent efb159a commit 6f30aea
Show file tree
Hide file tree
Showing 38 changed files with 128 additions and 132 deletions.
10 changes: 5 additions & 5 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 @@ -155,8 +155,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
8 changes: 4 additions & 4 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
plugins {
id 'java-library'
id "io.freefair.lombok"
id 'com.diffplug.spotless' version '6.19.0'
id 'com.diffplug.spotless' version '6.22.0'
}

repositories {
Expand All @@ -47,9 +47,9 @@ 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('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
13 changes: 6 additions & 7 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {
id 'jacoco'
id 'info.solidsoft.pitest' version '1.9.0'
id 'java-test-fixtures'
id 'com.diffplug.spotless' version '6.19.0'
id 'com.diffplug.spotless' version '6.22.0'

}

Expand Down Expand Up @@ -56,11 +56,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'
}

spotless {
Expand Down Expand Up @@ -91,8 +90,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
4 changes: 2 additions & 2 deletions doctest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id 'base'
id 'com.wiredforcode.spawn'
id "de.undercouch.download" version "5.3.0"
id 'com.diffplug.spotless' version '6.19.0'
id 'com.diffplug.spotless' version '6.22.0'
}

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

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

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
10 changes: 0 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
@rem
@rem Copyright OpenSearch Contributors
@rem SPDX-License-Identifier: Apache-2.0
@rem
@rem The OpenSearch Contributors require contributions made to
@rem this file be licensed under the Apache-2.0 license or a
@rem compatible open source license.
@rem
@rem Modifications Copyright OpenSearch Contributors. See
@rem GitHub history for details.
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
9 changes: 6 additions & 3 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.opensearch.gradle.test.RestIntegTestTask
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
import org.opensearch.gradle.testclusters.OpenSearchCluster
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestFramework

import groovy.xml.XmlParser
import java.nio.file.Paths
Expand All @@ -33,7 +35,7 @@ import java.util.stream.Collectors

plugins {
id "de.undercouch.download" version "5.3.0"
id 'com.diffplug.spotless' version '6.19.0'
id 'com.diffplug.spotless' version '6.22.0'
}

apply plugin: 'opensearch.build'
Expand Down Expand Up @@ -179,8 +181,9 @@ dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version:"${versions.log4j}"
testImplementation project(':opensearch-sql-plugin')
testImplementation project(':legacy')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.6.2')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.6.2')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.9.3')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.9.3')
testRuntimeOnly('org.junit.platform:junit-platform-launcher:1.9.3')

testImplementation group: 'com.h2database', name: 'h2', version: '2.2.220'
testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.41.2.2'
Expand Down
4 changes: 2 additions & 2 deletions legacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ plugins {
id 'java'
id 'io.freefair.lombok'
id 'antlr'
id 'com.diffplug.spotless' version '6.19.0'
id 'com.diffplug.spotless' version '6.22.0'
}

generateGrammarSource {
Expand Down Expand Up @@ -123,7 +123,7 @@ dependencies {
compileOnly group: 'javax.servlet', name: 'servlet-api', version:'2.5'

testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2'
testImplementation group: 'org.mockito', name: 'mockito-inline', version:'3.12.4'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package org.opensearch.sql.legacy.unittest;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package org.opensearch.sql.legacy.unittest;

import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.opensearch.core.common.bytes.BytesArray;
import org.opensearch.rest.RestRequest;
import org.opensearch.sql.legacy.esdomain.LocalClusterState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.opensearch.search.SearchHit;
import org.opensearch.search.SearchHits;
import org.opensearch.sql.legacy.executor.join.ElasticUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.opensearch.sql.legacy.expression.core.operator.ScalarOperation;

@RunWith(MockitoJUnitRunner.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.opensearch.sql.legacy.expression.core.operator.ScalarOperation;

@RunWith(MockitoJUnitRunner.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.opensearch.sql.legacy.expression.model.ExprValueFactory;
import org.opensearch.sql.legacy.expression.model.ExprValueUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.opensearch.sql.legacy.metrics.RollingCounter;

@RunWith(MockitoJUnitRunner.class)
Expand Down
Loading

0 comments on commit 6f30aea

Please sign in to comment.