Skip to content

Commit 7b22735

Browse files
authored
Merge pull request #1443 from lesserwhirls/winarm
Add libaec windows aarch support
2 parents fec016e + 3f57061 commit 7b22735

10 files changed

Lines changed: 72 additions & 14 deletions

File tree

.github/workflows/libaec.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
# Build libaec on windows (x86-64), linux (x86-64, aarch64), and mac
3-
# (x86-64, aarch64) and combine into a single artifact for use by
4-
# netCDF-Java.
2+
# Build libaec on windows (x86-64, aarch64), linux (x86-64, aarch64),
3+
# and mac (x86-64, aarch64) and combine into a single artifact for use
4+
# by netCDF-Java.
55
#
66
# The version of libaec is used twice in this workflow - once in the
77
# ref of the checkout, and once in the name of the final artifact.

.github/workflows/test-native-compression.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
- 'native-compression/libaec-jna/**'
66
- 'native-compression/libaec-native/**'
77
- 'native-compression/build.gradle'
8+
- '.github/workflows/test-native-compression.yml'
89

910
jobs:
1011
tests:
@@ -14,6 +15,7 @@ jobs:
1415
ubuntu-24.04,
1516
ubuntu-24.04-arm,
1617
windows-2022,
18+
windows-11-arm,
1719
macos-14,
1820
macos-13
1921
]
@@ -22,10 +24,17 @@ jobs:
2224
steps:
2325
- uses: actions/checkout@v4
2426
- name: Set up JDK 11
27+
if: ${{ matrix.os != 'windows-11-arm' }}
2528
uses: actions/setup-java@v4
2629
with:
2730
distribution: 'temurin'
2831
java-version: '11'
32+
- name: Set up JDK 21
33+
if: ${{ matrix.os == 'windows-11-arm' }}
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: 'temurin'
37+
java-version: '21'
2938
- name: Cache Gradle packages
3039
uses: actions/cache@v4
3140
with:
@@ -36,7 +45,7 @@ jobs:
3645
restore-keys: |
3746
${{ runner.os }}-gradle-
3847
- name: Run libaec JNA tests
39-
run: ./gradlew clean :native-compression:libaec-jna:test
48+
run: ./gradlew clean :native-compression:libaec-jna:simpleTests
4049
- uses: actions/upload-artifact@v4
4150
if: failure()
4251
with:

docs/src/site/pages/netcdfJava_tutorial/overview/UsingNetcdfJava.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ To ease the use of this feature, we now distribute a jar file containing the nat
134134
|:-|:-:|:-:
135135
| Linux | <span class="glyphicon glyphicon-ok" style="color: green;"></span> | <span class="glyphicon glyphicon-ok" style="color: green;">
136136
| MacOS | <span class="glyphicon glyphicon-ok" style="color: green;"> | <span class="glyphicon glyphicon-ok" style="color: green;">
137-
| Windows | <span class="glyphicon glyphicon-ok" style="color: green;"> | <span class="glyphicon glyphicon-remove" style="color: red;">
137+
| Windows | <span class="glyphicon glyphicon-ok" style="color: green;"> | <span class="glyphicon glyphicon-ok" style="color: green;">
138138

139139
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.
140140
Otherwise, libaec will need to be installed and reachable in your system library path in order to read data compressed using libaec.

gradle/any/testing.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ tasks.withType(Test).all {
1717

1818
useJUnit {
1919
// if we are not explicitly trying to run all tests, allow some categories to be ignored
20-
if (!runAllTests) {
20+
// test tasks named 'simpleTests' do not depend on cdm-test-utils, so do not apply category
21+
// filters (e.g. :native-compression:libaec-jna:simpleTests)
22+
if (!runAllTests && !name.equals('simpleTests')) {
2123
if (isJenkins) {
2224
excludeCategories 'ucar.unidata.util.test.category.NotJenkins'
2325
}

native-compression/libaec-jna/build.gradle

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,34 @@ apply from: "$rootDir/gradle/any/java-library.gradle"
44
description = 'Java bindings for decoding libaec compression using JNA'
55
ext.title = 'libaec compression decoder using JNA'
66

7+
sourceSets {
8+
simpleTests {
9+
//resources.srcDirs = [file('src/simpleTests/resources')]
10+
compileClasspath += sourceSets.main.output + configurations.compileClasspath
11+
runtimeClasspath += output + sourceSets.main.output + configurations.runtimeClasspath
12+
}
13+
}
14+
15+
// unloaded test task using "configuration avoidance"
16+
def simpleTests = tasks.register('simpleTests', Test) {
17+
group = 'verification'
18+
description = 'Runs tests that do not depend on cdm-test-utils (specifically cdm-core)'
19+
testClassesDirs = sourceSets.simpleTests.output.classesDirs
20+
classpath = sourceSets.simpleTests.runtimeClasspath
21+
}
22+
23+
test.dependsOn(simpleTests)
24+
725
dependencies {
826
api enforcedPlatform(project(':netcdf-java-platform'))
9-
testImplementation enforcedPlatform(project(':netcdf-java-testing-platform'))
27+
simpleTestsImplementation enforcedPlatform(project(':netcdf-java-platform'))
28+
simpleTestsImplementation enforcedPlatform(project(':netcdf-java-testing-platform'))
1029

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

14-
testImplementation project(':cdm-test-utils')
15-
16-
testImplementation 'com.google.truth:truth'
33+
simpleTestsImplementation 'com.google.truth:truth'
1734

18-
testRuntimeOnly project(':native-compression:libaec-native')
19-
testRuntimeOnly 'ch.qos.logback:logback-classic'
35+
simpleTestsRuntimeOnly project(':native-compression:libaec-native')
36+
simpleTestsRuntimeOnly 'ch.qos.logback:logback-classic'
2037
}

native-compression/libaec-jna/src/test/java/edu/ucar/unidata/compression/jna/libaec/TestLibAec.java renamed to native-compression/libaec-jna/src/simpleTests/java/edu/ucar/unidata/compression/jna/libaec/TestLibAec.java

File renamed without changes.

native-compression/libaec-jna/src/test/java/edu/ucar/unidata/compression/jna/libaec/TestLibAecMultithreaded.java renamed to native-compression/libaec-jna/src/simpleTests/java/edu/ucar/unidata/compression/jna/libaec/TestLibAecMultithreaded.java

File renamed without changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE for license information.
4+
*/
5+
6+
package edu.ucar.unidata.compression.jna.libaec;
7+
8+
import static com.google.common.truth.Truth.assertThat;
9+
10+
import org.junit.Test;
11+
12+
public class TestLoadLibAec {
13+
14+
@Test
15+
public void testBasicLoad() {
16+
LibAec libAec = new LibAec();
17+
assertThat(libAec).isNotNull();
18+
}
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<configuration>
2+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
3+
<encoder>
4+
<pattern>%highlight([%d{HH:mm:ss.SSS} %-5level %logger{36}]) %message%n</pattern>
5+
</encoder>
6+
</appender>
7+
8+
<root level="DEBUG">
9+
<appender-ref ref="STDOUT" />
10+
</root>
11+
</configuration>

native-compression/libaec-native/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ description = 'Jar distribution of native libraries for libaec compression.'
77
ext.title = 'Native libraries for libaec.'
88

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

1212
// sha256 checksum from GitHub workflow output
13-
def expectedChecksum = 'f8273bf7eef9aef6bf4766301d978a2dea7cefcad72a2d7c2d655299d5847a4b'
13+
def expectedChecksum = '3db1ba7bc95b48eff74501382b90b0c7d0770a98f369d8c376c8ca4b6003487e'
1414

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

0 commit comments

Comments
 (0)