Skip to content

Commit

Permalink
Fix a native library location for osx/amd64 (#26)
Browse files Browse the repository at this point in the history
Fix a native library location for osx/amd64
  • Loading branch information
vsuharnikov authored Oct 16, 2023
1 parent 59c451a commit 6a4ce23
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
# Where a library should be
target-path: ${{ matrix.jni-platform }}/${{ matrix.arch }}
target-path: ${{ matrix.jni-platform }}/${{ matrix.target-arch }}

# Rust build target
build-target: ${{ matrix.build-arch }}-${{ matrix.build-platform }}
Expand All @@ -41,6 +41,18 @@ jobs:
arch: aarch64

include:
- arch: aarch64
build-arch: aarch64
target-arch: aarch64

- arch: amd64
build-arch: x86_64
target-arch: amd64

- arch: x86
build-arch: i686
target-arch: x86

- platform: linux
os: ubuntu-20.04
build-platform: unknown-linux-gnu
Expand All @@ -62,6 +74,11 @@ jobs:
artifact: libzwaves_jni.dylib
jni-platform: osx64

- platform: osx
arch: amd64
# https://github.com/openjdk/jdk/commit/5b1baa3d10d9ef3f07f133ece8a5f1d40311c74d#diff-6078ab1e47c6bb312b7f41e7539b4849189260c38f9b359c205a5aa0f633533dR278
target-arch: x86_64

- platform: windows
os: windows-2019
build-platform: pc-windows-msvc # x86 and gcc lead to "undefined reference to _Unwind_Resume"
Expand All @@ -71,15 +88,6 @@ jobs:
- platform: windows
arch: x86
jni-platform: windows32

- arch: aarch64
build-arch: aarch64

- arch: amd64
build-arch: x86_64

- arch: x86
build-arch: i686
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -146,16 +154,16 @@ jobs:
- name: Print debug information
run: |
cd ./zwaves_jni/javalib
# About -q: https://github.com/gradle/gradle/issues/5098#issuecomment-1084652709
VERSION=$(./gradlew -q $GRADLE_EXTRA_ARGS printVersion)
PUBLISHING_TYPE=$(./gradlew -q $GRADLE_EXTRA_ARGS publishingType)
# echo "$GITHUB_CONTEXT" # For debugging purposes
echo "Gradle extra arguments: ${GRADLE_EXTRA_ARGS}"
echo "Building ${VERSION}, publishing type: ${PUBLISHING_TYPE}"
# Make environment variables available in the next step
echo "PUBLISHING_TYPE=${PUBLISHING_TYPE}" >> $GITHUB_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public class ZWavesJNILibrary {
static {
// Our layout: "META-INF/native/${platform}/${arch}/${library[-version]}"
new JNILibrary("zwaves_jni", ZWavesJNILibrary.class).load();
}

Expand Down

0 comments on commit 6a4ce23

Please sign in to comment.