Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade gradle to 8.5 #2470

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .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
1 change: 1 addition & 0 deletions .github/workflows/sql-pitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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
1 change: 1 addition & 0 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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
1 change: 1 addition & 0 deletions .github/workflows/sql-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ buildscript {
}

plugins {
id 'nebula.ospackage' version "8.3.0"
id "com.netflix.nebula.ospackage" version "11.6.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'
}
Expand Down Expand Up @@ -155,8 +155,8 @@ jacoco {
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
xml.setRequired(false)
csv.setRequired(false)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
4 changes: 2 additions & 2 deletions datasources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Copyright OpenSearch Contributors
# 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.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
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
6 changes: 3 additions & 3 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ ext {
cluster.getNodes().forEach { node ->
var creds = node.getCredentials()
if (creds.isEmpty()) {
creds.add(Map.of('useradd', 'admin', '-p', 'admin'))
creds.add(Map.of('useradd', 'admin', '-p', 'myStrongPassword123!'))
} else {
creds.get(0).putAll(Map.of('useradd', 'admin', '-p', 'admin'))
creds.get(0).putAll(Map.of('useradd', 'admin', '-p', 'myStrongPassword123!'))
}
}

Expand Down Expand Up @@ -500,7 +500,7 @@ task comparisonTest(type: RestIntegTestTask) {
return new RegularFile() {
@Override
File getAsFile() {
return configurations.zipArchive.asFileTree.matching {
configurations.zipArchive.asFileTree.matching {
include '**/opensearch-sql-plugin*'
}.singleFile
}
Expand Down
4 changes: 2 additions & 2 deletions opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
8 changes: 3 additions & 5 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ testingConventions.enabled = false
thirdPartyAudit.enabled = false


apply plugin: 'nebula.ospackage'
apply plugin: 'com.netflix.nebula.ospackage'
validateNebulaPom.enabled = false

// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
Expand Down Expand Up @@ -245,8 +245,7 @@ afterEvaluate {
task renameRpm(type: Copy) {
from("$buildDir/distributions")
into("$buildDir/distributions")
include archiveName
rename archiveName, "${packageName}-${version}.rpm"
rename "$archiveFileName", "${packageName}-${version}.rpm"
doLast { delete file("$buildDir/distributions/$archiveName") }
}
}
Expand All @@ -258,8 +257,7 @@ afterEvaluate {
task renameDeb(type: Copy) {
from("$buildDir/distributions")
into("$buildDir/distributions")
include archiveName
rename archiveName, "${packageName}-${version}.deb"
rename "$archiveFileName", "${packageName}-${version}.deb"
doLast { delete file("$buildDir/distributions/$archiveName") }
}
}
Expand Down
4 changes: 2 additions & 2 deletions ppl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
4 changes: 2 additions & 2 deletions prometheus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ configurations.all {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
4 changes: 2 additions & 2 deletions protocol/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
4 changes: 2 additions & 2 deletions spark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ jacocoTestReport {
dependsOn test, junit4
executionData test, junit4
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
4 changes: 2 additions & 2 deletions sql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ test {

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
html.required.set(true)
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand Down
Loading