diff --git a/notifications/build-tools/merged-coverage.gradle b/notifications/build-tools/merged-coverage.gradle index c4e07ab75d7..83fa44d2090 100644 --- a/notifications/build-tools/merged-coverage.gradle +++ b/notifications/build-tools/merged-coverage.gradle @@ -13,26 +13,18 @@ allprojects { } } -task jacocoMerge(type: JacocoMerge) { +task jacocoReport(type: JacocoReport, group: 'verification') { + description = 'Generates an aggregate report from all subprojects' gradle.projectsEvaluated { - subprojects.each { - jacocoMerge.dependsOn it.tasks.withType(JacocoReport) - jacocoMerge.executionData it.tasks.withType(JacocoReport).collect { it.executionData } + subprojects.each { + jacocoReport.dependsOn it.tasks.withType(JacocoReport) + jacocoReport.executionData it.tasks.withType(JacocoReport).collect { it.executionData } } } - doFirst { - executionData = files(executionData.findAll { it.exists() }) - } -} - -task jacocoReport(type: JacocoReport, group: 'verification') { - description = 'Generates an aggregate report from all subprojects' - dependsOn jacocoMerge - executionData jacocoMerge.destinationFile reports { - html.enabled = true // human readable - xml.enabled = true + html.required = true // human readable + xml.required = true } gradle.projectsEvaluated { diff --git a/notifications/build-tools/plugin-coverage.gradle b/notifications/build-tools/plugin-coverage.gradle index 29cba775009..948da1a8e58 100644 --- a/notifications/build-tools/plugin-coverage.gradle +++ b/notifications/build-tools/plugin-coverage.gradle @@ -53,8 +53,8 @@ jacocoTestReport { getSourceDirectories().from(sourceSets.main.allSource) getClassDirectories().from(sourceSets.main.output) reports { - html.enabled = true // human readable - xml.enabled = true // for coverlay + html.required = true // human readable + xml.required = true // for coverlay } } diff --git a/notifications/core-spi/build.gradle b/notifications/core-spi/build.gradle index 1e42a59d53c..6af350457ce 100644 --- a/notifications/core-spi/build.gradle +++ b/notifications/core-spi/build.gradle @@ -158,5 +158,5 @@ shadowJar { relocate 'org.apache.commons.codec', 'org.opensearch.notifications.core.repackage.org.apache.commons.codec' relocate 'com.amazonaws', 'org.opensearch.notifications.core.repackage.com.amazonaws' relocate 'software.amazon.ion', 'org.opensearch.notifications.core.repackage.software.amazon.ion' - classifier = null + archiveClassifier.set('') } diff --git a/notifications/core/build.gradle b/notifications/core/build.gradle index 238bba9881f..dcb7bea4ccb 100644 --- a/notifications/core/build.gradle +++ b/notifications/core/build.gradle @@ -9,7 +9,7 @@ plugins { id 'jacoco' id 'maven-publish' id 'signing' - id 'nebula.ospackage' version "8.5.4" + id "com.netflix.nebula.ospackage" version "11.3.0" } repositories { @@ -187,7 +187,7 @@ afterEvaluate { version = "${project.version}" - "-SNAPSHOT" into '/usr/share/opensearch/plugins' - from(zipTree(bundlePlugin.archivePath)) { + from(zipTree(bundlePlugin.archiveFile)) { into opensearchplugin.name } @@ -213,13 +213,25 @@ afterEvaluate { buildRpm { arch = 'NOARCH' - archiveName "${packageName}-${version}.rpm" dependsOn 'assemble' + finalizedBy 'renameRpm' + task renameRpm(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + rename "$archiveFileName", "${packageName}-${version}.rpm" + doLast { delete file("$buildDir/distributions/$archiveFileName") } + } } buildDeb { arch = 'amd64' - archiveName "${packageName}-${version}.deb" dependsOn 'assemble' + finalizedBy 'renameRpm' + task renameDeb(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + rename "$archiveFileName", "${packageName}-${version}.deb" + doLast { delete file("$buildDir/distributions/$archiveFileName") } + } } } diff --git a/notifications/gradle/wrapper/gradle-wrapper.jar b/notifications/gradle/wrapper/gradle-wrapper.jar index 249e5832f09..c1962a79e29 100644 Binary files a/notifications/gradle/wrapper/gradle-wrapper.jar and b/notifications/gradle/wrapper/gradle-wrapper.jar differ diff --git a/notifications/gradle/wrapper/gradle-wrapper.properties b/notifications/gradle/wrapper/gradle-wrapper.properties index ae04661ee73..37aef8d3f0c 100644 --- a/notifications/gradle/wrapper/gradle-wrapper.properties +++ b/notifications/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/notifications/gradlew b/notifications/gradlew index a69d9cb6c20..aeb74cbb43e 100755 --- a/notifications/gradlew +++ b/notifications/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# 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"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -143,12 +140,16 @@ fi 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 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 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# 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, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/notifications/gradlew.bat b/notifications/gradlew.bat index 53a6b238d41..6689b85beec 100644 --- a/notifications/gradlew.bat +++ b/notifications/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/notifications/notifications/build.gradle b/notifications/notifications/build.gradle index b3076350236..e3ba17ae818 100644 --- a/notifications/notifications/build.gradle +++ b/notifications/notifications/build.gradle @@ -9,8 +9,8 @@ import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask import java.util.concurrent.Callable plugins { - id 'nebula.ospackage' version "8.5.4" - id "com.dorongold.task-tree" version "2.0" + id "com.dorongold.task-tree" version "2.1.1" + id "com.netflix.nebula.ospackage" version "11.3.0" } apply plugin: 'java' @@ -21,7 +21,6 @@ apply plugin: 'opensearch.pluginzip' apply plugin: 'opensearch.testclusters' apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'org.jetbrains.kotlin.plugin.allopen' -apply plugin: 'nebula.ospackage' def usingRemoteCluster = System.properties.containsKey('tests.rest.cluster') || System.properties.containsKey('tests.cluster') def usingMultiNode = project.properties.containsKey('numNodes') @@ -472,13 +471,25 @@ afterEvaluate { buildRpm { arch = 'NOARCH' - archiveName "${packageName}-${version}.rpm" dependsOn 'assemble' + finalizedBy 'renameRpm' + task renameRpm { + from("$buildDir/distributions") + into("$buildDir/distributions") + rename "$archiveFileName", "${packageName}-${version}.rpm" + doLast { delete file("$buildDir/distributions/$archiveFileName") } + } } buildDeb { - arch = 'amd64' - archiveName "${packageName}-${version}.deb" + arch = 'all' dependsOn 'assemble' + finalizedBy 'renameDeb' + task renameDeb(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + rename "$archiveFileName", "${packageName}-${version}.deb" + doLast { delete file("$buildDir/distributions/$archiveFileName") } + } } }