File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Samples/SwiftAndJavaJarSampleLib Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 88# check if we can compile a plain Example file that uses the generated Java bindings that should be in the generated jar
99javac -cp bin/default/build/libs/* jar Example.java
1010
11-
1211if [ " $( uname -s) " = ' Linux' ]
1312then
14- exit 1 # not implemented yet
13+ SWIFT_LIB_PATHS=$HOME /.local/share/swiftly/toolchains/6.2-snapshot-2025-06-17/usr/lib/swift/linux/
14+ SWIFT_LIB_PATHS=" ${SWIFT_LIB_PATHS} :$( find . | grep libMySwiftLibrary.so$ | sort | head -n1 | xargs dirname) "
1515elif [ " $( uname -s) " = ' Darwin' ]
1616then
17- # Can we run the example?
1817 # - find libswiftCore.dylib
19- SWIFT_DYLIB_PATHS =$( find " $( swiftly use --print-location) " | grep dylib$ | grep libswiftCore | grep macos | xargs dirname)
18+ SWIFT_LIB_PATHS =$( find " $( swiftly use --print-location) " | grep dylib$ | grep libswiftCore | grep macos | xargs dirname)
2019 # - find our library dylib
21- SWIFT_DYLIB_PATHS=" ${SWIFT_DYLIB_PATHS} :$( find . | grep libMySwiftLibrary.dylib$ | sort | head -n1 | xargs dirname) "
22- java -Djava.library.path=" ${SWIFT_DYLIB_PATHS} " -cp " .:bin/default/build/libs/*jar:../../SwiftKit/build/libs/*jar" Example
23- fi
20+ SWIFT_LIB_PATHS=" ${SWIFT_LIB_PATHS} :$( find . | grep libMySwiftLibrary.dylib$ | sort | head -n1 | xargs dirname) "
21+ fi
22+
23+ # Can we run the example?
24+ java --enable-native-access=ALL-UNNAMED \
25+ -Djava.library.path=" ${SWIFT_LIB_PATHS} " -cp " .:bin/default/build/libs/*:../../SwiftKit/build/libs/*" \
26+ Example
You can’t perform that action at this time.
0 commit comments