Skip to content

Commit

Permalink
test macos arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Apr 25, 2024
1 parent 7b2a3a5 commit 284a25a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/jni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, macos-14]

steps:
- uses: actions/checkout@v4
Expand All @@ -49,6 +49,11 @@ jobs:
with:
key: ${{ matrix.os }}

- name: OS info
shell: bash
run: |
uname -a
- name: Display kotlin version
shell: bash
run: |
Expand All @@ -58,6 +63,7 @@ jobs:
shell: bash
run: |
java -version
javac -help
echo "JAVA_HOME is: ${JAVA_HOME}"
- name: Run JNI test
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/run-java-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest, macos-14]

steps:
- uses: actions/checkout@v4
Expand All @@ -50,10 +50,24 @@ jobs:
with:
key: ${{ matrix.os }}-java

- name: OS info
shell: bash
run: |
uname -a
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'

- name: Display java version
shell: bash
run: |
java -version
java -help
echo "----"
javac -version
javac -help
echo "JAVA_HOME is: ${JAVA_HOME}"
cmake --version
Expand Down
6 changes: 4 additions & 2 deletions sherpa-onnx/java-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ $(info -- class files $(class_files))
all: $(out_jar)

$(out_jar): $(class_files)
jar --create --verbose --file $(out_jar) -C $(out_dir) .
# jar --create --verbose --file $(out_jar) -C $(out_dir) ./
jar cvf $(out_jar) -C $(out_dir) ./

clean:
$(RM) -rfv $(out_dir)

$(class_files): $(out_dir)/$(package_dir)/%.class: src/$(package_dir)/%.java
javac -d $(out_dir) --class-path $(out_dir) $<
mkdir -p build
javac -d $(out_dir) -cp $(out_dir) $<
1 change: 1 addition & 0 deletions sherpa-onnx/jni/wave-reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <fstream>

#include "sherpa-onnx/csrc/macros.h"
#include "sherpa-onnx/csrc/onnx-utils.h"
#include "sherpa-onnx/jni/common.h"

static jobjectArray ReadWaveImpl(JNIEnv *env, std::istream &is,
Expand Down

0 comments on commit 284a25a

Please sign in to comment.