diff --git a/build-logic-ncj/build.gradle.kts b/build-logic-ncj/build.gradle.kts index 0e030b454f..c910841c14 100644 --- a/build-logic-ncj/build.gradle.kts +++ b/build-logic-ncj/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata + * Copyright (c) 2025-2026 University Corporation for Atmospheric Research/Unidata * See LICENSE for license information. */ @@ -7,11 +7,13 @@ plugins { `kotlin-dsl` alias(ncjLibs.plugins.protobuf) alias(ncjLibs.plugins.spotless) + alias(ncjLibs.plugins.versions) } dependencies { implementation(plugin(ncjLibs.plugins.protobuf)) implementation(plugin(ncjLibs.plugins.spotless)) + implementation(plugin(ncjLibs.plugins.versions)) } spotless { diff --git a/build-logic-ncj/src/main/kotlin/ncj-versions-conventions.gradle.kts b/build-logic-ncj/src/main/kotlin/ncj-versions-conventions.gradle.kts new file mode 100644 index 0000000000..52b05438f5 --- /dev/null +++ b/build-logic-ncj/src/main/kotlin/ncj-versions-conventions.gradle.kts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2026 University Corporation for Atmospheric Research/Unidata + * See LICENSE for license information. + */ + +import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask + +plugins { id("com.github.ben-manes.versions") } + +// https://github.com/ben-manes/gradle-versions-plugin +fun isNonStable(version: String): Boolean { + val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } + val regex = "^[0-9,.v-]+(-r)?$".toRegex() + val isStable = stableKeyword || regex.matches(version) + return isStable.not() +} + +// don't suggest release candidates if currently on a stable version +tasks.withType { + rejectVersionIf { isNonStable(candidate.version) && !isNonStable(currentVersion) } +} diff --git a/build.gradle.kts b/build.gradle.kts index ad4485b2a9..89add7212c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,12 @@ /* - * Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata + * Copyright (c) 2025-2026 University Corporation for Atmospheric Research/Unidata * See LICENSE for license information. */ plugins { id("ncj-java-base-conventions") alias(ncjLibs.plugins.spotless) + id("ncj-versions-conventions") } description = "The Unidata netCDF-Java library (aka CDM)." @@ -14,8 +15,8 @@ description = "The Unidata netCDF-Java library (aka CDM)." // and run ./gradlew wrapper twice tasks.wrapper { distributionType = Wrapper.DistributionType.ALL - gradleVersion = "9.4.0" - distributionSha256Sum = "b21468753cb43c167738ee04f10c706c46459cf8f8ae6ea132dc9ce589a261f2" + gradleVersion = "9.5.0" + distributionSha256Sum = "a3c4ba4aca8f0075688b9c5b18939fd28e8cb4357c227da5c1d9f38343791439" } spotless { @@ -42,3 +43,7 @@ tasks.register("buildPublicArtifacts") { } dependsOn(":uber-jars:buildNetcdfAll", ":uber-jars:buildToolsUI", ":uber-jars:buildNcIdv") } + +// we need some things from ncj-java-base-conventions for the root project, +// but not because we are making a jar +tasks.jar { enabled = false } diff --git a/gradle/ncj.libs.versions.toml b/gradle/ncj.libs.versions.toml index 2fa9172ca4..066ec1b2c7 100644 --- a/gradle/ncj.libs.versions.toml +++ b/gradle/ncj.libs.versions.toml @@ -4,46 +4,48 @@ netcdf-java = "5.10.0-SNAPSHOT" unidata-doc-theme = "0.1.1" # 3rd party dependencies -awssdk = "2.31.76" -awssdkv1 = "1.12.649" +awssdk = "2.43.0" +awssdkv1 = "1.12.797" commons-math3 = "3.6.1" bounce = "0.18" -grpc = "1.73.0" -guava = "33.4.8-jre" -httpcomponents = "4.5.13" -jackson = "2.21.1" -jcommander = "1.78" +grpc = "1.80.0" +guava = "33.6.0-jre" +httpcomponents = "4.5.14" +jackson = "2.21.3" +jcommander = "1.82" jdom2 = "2.0.6.1" -jfree-jcommon = "1.0.23" +jfree-jcommon = "1.0.24" jfree-jfreechart = "1.0.19" jgoodies-forms = "1.6.0" jj2000 = "5.4" -joda-time = "2.12.7" +joda-time = "2.14.2" jsr305 = "3.0.2" -jna = "5.17.0" -lgooddatepicker = "10.3.1" +jna = "5.18.1" +lgooddatepicker = "11.2.1" mcidas = "20231121" -protobuf = "4.31.1" -re2j = "1.3" +protobuf = "4.34.1" +re2j = "1.8" sensorweb-waterml = "2.7.0" slf4j = "2.0.17" tomcat-annotations = "6.0.53" -visad = "2.0-20130124" +visad = "2.0-20191209" xmlbeans = "3.1.0" #testing only -commons-compress = "1.12" -commons-io = "2.5" -jsoup = "1.11.2" -junit4 = "4.13.1" -junit5 = "5.14.0" +commons-compress = "1.28.0" +commons-io = "2.22.0" +jsoup = "1.22.2" +junit4 = "4.13.2" +junit5 = "5.14.4" junitparams = "1.0.5" mockito-core = "2.28.2" testcontainers = "1.21.4" -truth = "1.0" +truth = "1.4.5" # runtime only -logback-classic = "1.3.15" +# locked to 1.3.x as this is the last version to support Java 8 +# used at runtime by gcdm, uicdm (i.e., toolsUI), used by most tests +logback-classic = "1.3.16" [libraries] @@ -111,9 +113,10 @@ pragmatists-junitparams = { module = "pl.pragmatists:JUnitParams", version.ref = logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback-classic" } [plugins] -cyclonedx-bom = { id = "org.cyclonedx.bom", version = "3.2.0" } +cyclonedx-bom = { id = "org.cyclonedx.bom", version = "3.2.4" } execfork = { id = "com.github.psxpaul.execfork", version = "0.2.2"} javacc = { id = "org.javacc.javacc", version = "4.0.3" } -protobuf = { id = "com.google.protobuf", version = "0.9.6" } -shadow = { id = "com.gradleup.shadow", version = "9.3.2" } -spotless = { id = "com.diffplug.spotless", version = "8.3.0" } +protobuf = { id = "com.google.protobuf", version = "0.10.0" } +shadow = { id = "com.gradleup.shadow", version = "9.4.1" } +spotless = { id = "com.diffplug.spotless", version = "8.4.0" } +versions = { id = "com.github.ben-manes.versions", version = "0.54.0" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d997cfc60f..b1b8ef56b4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5e1b8a0423..fd771c85c4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,10 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=b21468753cb43c167738ee04f10c706c46459cf8f8ae6ea132dc9ce589a261f2 -distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-all.zip +distributionSha256Sum=a3c4ba4aca8f0075688b9c5b18939fd28e8cb4357c227da5c1d9f38343791439 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-all.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 0262dcbd52..b9bb139f79 100755 --- a/gradlew +++ b/gradlew @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index c4bdd3ab8e..24c62d56f2 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -23,8 +23,8 @@ @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,7 +65,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line @@ -73,21 +73,10 @@ goto fail @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/uber-jars/build.gradle.kts b/uber-jars/build.gradle.kts index 0b9f99ed42..a3c1cb853e 100644 --- a/uber-jars/build.gradle.kts +++ b/uber-jars/build.gradle.kts @@ -1,10 +1,12 @@ /* - * Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata + * Copyright (c) 2025-2026 University Corporation for Atmospheric Research/Unidata * See LICENSE for license information. */ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import java.security.MessageDigest +import java.text.SimpleDateFormat +import java.util.Date import org.cyclonedx.gradle.CyclonedxDirectTask plugins { @@ -82,7 +84,13 @@ val buildNcIdv = exclude("nom/**") exclude("visad/**") - doFirst { manifest.attributes["Implementation-Title"] = "ncIdv jar" } + doFirst { + manifest.attributes(project(":cdm-core").tasks.jar.get().manifest.attributes) + manifest.attributes["Implementation-Title"] = "ncIdv jar" + manifest { + attributes["Built-On"] = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(Date()) + } + } } val buildNetcdfAll =