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
6 changes: 3 additions & 3 deletions .github/workflows/libaec.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Build libaec on windows (x86-64), linux (x86-64, aarch64), and mac
# (x86-64, aarch64) and combine into a single artifact for use by
# netCDF-Java.
# Build libaec on windows (x86-64, aarch64), linux (x86-64, aarch64),
# and mac (x86-64, aarch64) and combine into a single artifact for use
# by netCDF-Java.
#
# The version of libaec is used twice in this workflow - once in the
# ref of the checkout, and once in the name of the final artifact.
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test-native-compression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- 'native-compression/libaec-jna/**'
- 'native-compression/libaec-native/**'
- 'native-compression/build.gradle'
- '.github/workflows/test-native-compression.yml'

jobs:
tests:
Expand All @@ -14,6 +15,7 @@ jobs:
ubuntu-24.04,
ubuntu-24.04-arm,
windows-2022,
windows-11-arm,
macos-14,
macos-13
]
Expand All @@ -22,10 +24,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
if: ${{ matrix.os != 'windows-11-arm' }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Set up JDK 21
if: ${{ matrix.os == 'windows-11-arm' }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
Expand All @@ -36,7 +45,7 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Run libaec JNA tests
run: ./gradlew clean :native-compression:libaec-jna:test
run: ./gradlew clean :native-compression:libaec-jna:simpleTests
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ To ease the use of this feature, we now distribute a jar file containing the nat
|:-|:-:|:-:
| Linux | <span class="glyphicon glyphicon-ok" style="color: green;"></span> | <span class="glyphicon glyphicon-ok" style="color: green;">
| MacOS | <span class="glyphicon glyphicon-ok" style="color: green;"> | <span class="glyphicon glyphicon-ok" style="color: green;">
| Windows | <span class="glyphicon glyphicon-ok" style="color: green;"> | <span class="glyphicon glyphicon-remove" style="color: red;">
| Windows | <span class="glyphicon glyphicon-ok" style="color: green;"> | <span class="glyphicon glyphicon-ok" style="color: green;">

If you are using on the of the supported platform/architecture combinations above, you may include the `edu.ucar:libaec-native:${netcdfJavaVersion}` artifact in your project to bypass the need to install libaec on your system.
Otherwise, libaec will need to be installed and reachable in your system library path in order to read data compressed using libaec.
Expand Down
4 changes: 3 additions & 1 deletion gradle/any/testing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ tasks.withType(Test).all {

useJUnit {
// if we are not explicitly trying to run all tests, allow some categories to be ignored
if (!runAllTests) {
// test tasks named 'simpleTests' do not depend on cdm-test-utils, so do not apply category
// filters (e.g. :native-compression:libaec-jna:simpleTests)
if (!runAllTests && !name.equals('simpleTests')) {
if (isJenkins) {
excludeCategories 'ucar.unidata.util.test.category.NotJenkins'
}
Expand Down
29 changes: 23 additions & 6 deletions native-compression/libaec-jna/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@ apply from: "$rootDir/gradle/any/java-library.gradle"
description = 'Java bindings for decoding libaec compression using JNA'
ext.title = 'libaec compression decoder using JNA'

sourceSets {
simpleTests {
//resources.srcDirs = [file('src/simpleTests/resources')]
compileClasspath += sourceSets.main.output + configurations.compileClasspath
runtimeClasspath += output + sourceSets.main.output + configurations.runtimeClasspath
}
}

// unloaded test task using "configuration avoidance"
def simpleTests = tasks.register('simpleTests', Test) {
group = 'verification'
description = 'Runs tests that do not depend on cdm-test-utils (specifically cdm-core)'
testClassesDirs = sourceSets.simpleTests.output.classesDirs
classpath = sourceSets.simpleTests.runtimeClasspath
}

test.dependsOn(simpleTests)

dependencies {
api enforcedPlatform(project(':netcdf-java-platform'))
testImplementation enforcedPlatform(project(':netcdf-java-testing-platform'))
simpleTestsImplementation enforcedPlatform(project(':netcdf-java-platform'))
simpleTestsImplementation enforcedPlatform(project(':netcdf-java-testing-platform'))

api 'net.java.dev.jna:jna'
implementation 'org.slf4j:slf4j-api'

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

testImplementation 'com.google.truth:truth'
simpleTestsImplementation 'com.google.truth:truth'

testRuntimeOnly project(':native-compression:libaec-native')
testRuntimeOnly 'ch.qos.logback:logback-classic'
simpleTestsRuntimeOnly project(':native-compression:libaec-native')
simpleTestsRuntimeOnly 'ch.qos.logback:logback-classic'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
* See LICENSE for license information.
*/

package edu.ucar.unidata.compression.jna.libaec;

import static com.google.common.truth.Truth.assertThat;

import org.junit.Test;

public class TestLoadLibAec {

@Test
public void testBasicLoad() {
LibAec libAec = new LibAec();
assertThat(libAec).isNotNull();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%highlight([%d{HH:mm:ss.SSS} %-5level %logger{36}]) %message%n</pattern>
</encoder>
</appender>

<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
</configuration>
4 changes: 2 additions & 2 deletions native-compression/libaec-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ description = 'Jar distribution of native libraries for libaec compression.'
ext.title = 'Native libraries for libaec.'

// zip file produced by GitHub workflow
def libaecNative = 'libaec-native-1.1.3-1ef165d829f330d72d199d3c4655c327d339604d.zip'
def libaecNative = 'libaec-native-1.1.3-fec016ecd4b8ff1918877e582898d4257c405168.zip'

// sha256 checksum from GitHub workflow output
def expectedChecksum = 'f8273bf7eef9aef6bf4766301d978a2dea7cefcad72a2d7c2d655299d5847a4b'
def expectedChecksum = '3db1ba7bc95b48eff74501382b90b0c7d0770a98f369d8c376c8ca4b6003487e'

def resourceZip = new File("${rootDir}/project-files/native/libaec/${libaecNative}")

Expand Down
Loading