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 8
8
# check if we can compile a plain Example file that uses the generated Java bindings that should be in the generated jar
9
9
javac -cp bin/default/build/libs/* jar Example.java
10
10
11
-
12
11
if [ " $( uname -s) " = ' Linux' ]
13
12
then
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) "
15
15
elif [ " $( uname -s) " = ' Darwin' ]
16
16
then
17
- # Can we run the example?
18
17
# - 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)
20
19
# - 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