Skip to content
Merged
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
8 changes: 5 additions & 3 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
java-version: |
8
17
- name: Build with Gradle (refresh dependencies)
run: ./gradlew clean classes testClasses assemble --refresh-dependencies
- name: Build sourceJars
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/docs-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java 8
uses: actions/setup-java@v4
- name: Setup Java 8, 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '8'
java-version: |
8
17
- name: Cache Gradle packages
uses: actions/cache@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
Expand All @@ -20,5 +20,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Code Style Check with Gradle and Spotless
- name: build-logic Code Style Check with Gradle and Spotless
run: ./gradlew :build-logic:clean :build-logic:spotlessCheck
- name: netCDF-Java Code Style Check with Gradle and Spotless
run: ./gradlew clean spotlessCheck
25 changes: 16 additions & 9 deletions .github/workflows/test-native-compression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
ubuntu-24.04,
ubuntu-24.04-arm,
windows-2022,
windows-11-arm,
macos-13,
macos-14,
macos-15
Expand All @@ -24,15 +23,17 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
if: ${{ matrix.os != 'windows-11-arm' }}
uses: actions/setup-java@v4
- name: Setup JDK 8, 17
if: ${{ matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-13' }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
- name: Set up JDK 21
if: ${{ matrix.os == 'windows-11-arm' }}
uses: actions/setup-java@v4
java-version: |
8
17
- name: Setup JDK 21
if: ${{ matrix.os != 'ubuntu-24.04' && matrix.os != 'macos-13' }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
Expand All @@ -46,7 +47,13 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Run libaec JNA tests
run: ./gradlew clean :native-compression:libaec-jna:simpleTests
if: ${{ matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-13' }}
run: ./gradlew -Dorg.gradle.java.installations.auto-detect=true clean :libaec-jna:test
env:
JDK8: /usr/thredds-test-environment/temurin8
- name: Run libaec JNA tests (JDK 21 tests)
if: ${{ matrix.os != 'ubuntu-24.04' && matrix.os != 'macos-13' }}
run: ./gradlew clean :libaec-jna:test21
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ jobs:
java-vendor: ['zulu', 'temurin', 'corretto']
steps:
- uses: actions/checkout@v4
- name: Build and test with Gradle (${{ matrix.java-vendor }} ${{ matrix.java-version }})
- name: Build with ${{ matrix.java-vendor }} 17 and run tests with ${{ matrix.java-vendor }} ${{ matrix.java-version }}
uses: Unidata/thredds-test-action@v3
with:
java-vendor: ${{ matrix.java-vendor }}
java-version: ${{ matrix.java-version }}
java-version: 17
build-tool: 'gradlew'
test-command: '--info --stacktrace testAll'
test-command: '-Dorg.gradle.java.installations.fromEnv=JDK8 --info --stacktrace test'
env:
JDK8: /usr/thredds-test-environment/${{ matrix.java-vendor }}8
- name: Prep for artifact upload
if: failure()
run: rm -rf build-logic/build/tmp
- uses: actions/upload-artifact@v4
if: failure()
with:
name: netCDF-Java_JUnit_Results_${{ github.sha }}_${{ matrix.java-vendor }}-${{ matrix.java-version }}
path: build/reports/allTests
path: |
${{ github.workspace }}/**/build/reports/tests/**/*
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ bin/

# Ignore the Gradle cache directory.
.gradle/

# Ignore .kotlin directories
.kotlin/

# Ignore the output that Gradle generates in the "build/" directories...
build/

# ...but not the source code in the "edu.ucar.build" package inside buildSrc
!**/src/**/edu/ucar/build/

Expand Down
25 changes: 0 additions & 25 deletions bufr/build.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions bufr/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/

plugins {
id("java-library-conventions")
id("protobuf-conventions")
}

description = "Reading BUFR files with the NetCDF-java library."

extra["project.title"] = "BUFR IOSP"

dependencies {
implementation(platform(project(":netcdf-java-platform")))

api(project(":cdm-core"))

implementation(libs.beust.jcommander)
implementation(libs.findbugs.jsr305)
implementation(libs.guava)
implementation(libs.jdom2)
implementation(libs.protobuf)
implementation(libs.re2j)
implementation(libs.slf4j.api)

testImplementation(platform(project(":netcdf-java-testing-platform")))

testImplementation(project(":cdm-test-utils"))

testImplementation(libs.google.truth)

testCompileOnly(libs.junit4)

testRuntimeOnly(libs.junit5.platformLauncher)
testRuntimeOnly(libs.junit5.vintageEngine)
}
27 changes: 27 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/

plugins {
`kotlin-dsl`
alias(libs.plugins.protobuf)
alias(libs.plugins.spotless)
}

dependencies {
implementation(plugin(libs.plugins.protobuf))
implementation(plugin(libs.plugins.spotless))
}

spotless {
kotlinGradle {
target("*.gradle.kts", "**/*.gradle.kts")
ktfmt().googleStyle()
}
}

// Helper function that transforms a plugin alias from the version catalog
// into a valid dependency notation
fun plugin(plugin: Provider<PluginDependency>) =
plugin.map { "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}" }
15 changes: 15 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/

dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
mavenCentral()
gradlePluginPortal()
}
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } }
}

rootProject.name = "build-logic"
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/

plugins { `maven-publish` }

publishing {
repositories {
maven {
if ((project.extra.get("project.isRelease") as? Boolean ?: false)) {
name = "releases"
url = uri("https://artifacts.unidata.ucar.edu/repository/unidata-releases/")
} else {
name = "snapshots"
url = uri("https://artifacts.unidata.ucar.edu/repository/unidata-snapshots/")
}
credentials {
username = extra.properties["nexus.username"] as? String
password = extra.properties["nexus.password"] as? String
}
}
}
}

tasks.withType<GenerateModuleMetadata> { enabled = false }

val augmentPom =
tasks.register("augmentPom") {
publishing.publications.filterIsInstance<MavenPublication>().forEach { pub ->
pub.pom {
name.set("${project.group}:${project.name}")
url.set("${project.extra.get("project.url")}")
description.set("${project.description}")
licenses {
license {
name.set("BSD 3-Clause License")
url.set("https://github.com/Unidata/netcdf-java/blob/maint-5.x/LICENSE")
}
}
developers {
developer {
name.set("netCDF-Java Developers")
email.set("support-netcdf-java@unidata.ucar.edu")
organization.set("NSF Unidata")
organizationUrl.set("https://unidata.ucar.edu")
}
}
scm {
connection.set("scm:git:https://github.com/unidata/netcdf-java.git")
developerConnection.set("scm:git:https://github.com/unidata/netcdf-java.git")
url.set("https://github.com/unidata/netcdf-java")
}
}
}
}

tasks.withType<GenerateMavenPom>().configureEach { dependsOn(augmentPom) }
64 changes: 64 additions & 0 deletions build-logic/src/main/kotlin/base-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/

plugins { base }

val catalogs = extensions.getByType<VersionCatalogsExtension>()

group = "edu.ucar"

version = catalogs.named("libs").findVersion("netcdf-java").get().requiredVersion

description = "A component to the Unidata netCDF-Java library (aka CDM)."

extra["project.isRelease"] = !version.toString().endsWith("SNAPSHOT")

extra["project.title"] = "CDM modules"

extra["project.vendor"] = "UCAR/Unidata"

extra["project.url"] = "https://www.unidata.ucar.edu/software/netcdf-java/"

val docVersionParts = version.toString().split("-")[0].split(".")

assert(docVersionParts.size == 3)

extra["docVersion"] = docVersionParts[0] + "." + docVersionParts[1]

// list of subprojects that are intended for public use and make up the netCDF-Java project
// this is used by the netcdf-java-bom, docs, and code-coverage-report
// subprojects
val publicArtifacts =
listOf(
":bufr",
":cdm-core",
":cdm-image",
":cdm-mcidas",
":cdm-misc",
":cdm-radial",
":cdm-s3",
":cdm-vis5d",
":cdm-zarr",
":dap4",
":gcdm",
":grib",
":httpservices",
":legacy",
":libaec-jna",
":libaec-native",
":netcdf4",
":opendap",
":udunits",
":waterml",
)

project.extra["public.artifacts"] = publicArtifacts

// the minimumVersion of java supported
// will be the bytecode produced by the project for all java compilation
// will be used to run the tests (test, not testWithJdkX), generate code coverage reports, etc.
// other versions of java can be used to run the tests, but this is configured in
// testing-conventions.gradle.kts
project.extra["project.minimumJdkVersion"] = "8"
Loading
Loading