Skip to content

Commit 902b620

Browse files
committed
fixing classpaths and library paths...
1 parent df75e74 commit 902b620

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Samples/JavaDependencySampleApp/ci-validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ swift run --disable-sandbox
88

99
# explicitly invoke resolve without explicit path or dependency
1010
# the dependencies should be uses from the --swift-module
11-
.build/plugins/tools/debug/SwiftJavaTool-tool resolve \
11+
swift run swift-java resolve \
1212
Sources/JavaCommonsCSV/swift-java.config \
1313
--swift-module JavaCommonsCSV \
1414
--output-directory .build/plugins/outputs/javadependencysampleapp/JavaCommonsCSV/destination/SwiftJavaPlugin/

Samples/SwiftAndJavaJarSampleLib/ci-validate.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ set -x
99
export PATH="${PATH}:/usr/lib/jvm/jdk-24/bin"
1010

1111
# check if we can compile a plain Example file that uses the generated Java bindings that should be in the generated jar
12-
MYLIB_CLASSPATH="$(ls bin/default/build/libs/*.jar)"
12+
SWIFTKIT_CLASSPATH="$(pwd)/$(ls ../../SwiftKit/build/libs/*.jar | head -n1 | xargs dirname)"
13+
MYLIB_CLASSPATH="$(pwd)/$(ls bin/default/build/libs/*.jar | head -n1 | xargs dirname)"
14+
CLASSPATH="$(pwd):${SWIFTKIT_CLASSPATH}:${MYLIB_CLASSPATH}"
15+
echo "CLASSPATH = ${CLASSPATH}"
16+
1317
javac -cp "${MYLIB_CLASSPATH}" Example.java
1418

1519
if [ "$(uname -s)" = 'Linux' ]
@@ -19,12 +23,12 @@ then
1923
elif [ "$(uname -s)" = 'Darwin' ]
2024
then
2125
SWIFT_LIB_PATHS=$(find "$(swiftly use --print-location)" | grep dylib$ | grep libswiftCore | grep macos | xargs dirname)
22-
SWIFT_LIB_PATHS="${SWIFT_LIB_PATHS}:$(find . | grep libMySwiftLibrary.dylib$ | sort | head -n1 | xargs dirname)"
26+
SWIFT_LIB_PATHS="${SWIFT_LIB_PATHS}:$(pwd)/$(find . | grep libMySwiftLibrary.dylib$ | sort | head -n1 | xargs dirname)"
2327
fi
28+
echo "SWIFT_LIB_PATHS = ${SWIFT_LIB_PATHS}"
2429

2530
# Can we run the example?
26-
SWIFTKIT_CLASSPATH="$(ls ../../SwiftKit/build/libs/*.jar)"
2731
java --enable-native-access=ALL-UNNAMED \
28-
-Djava.library.path="${SWIFT_LIB_PATHS}" \
29-
-cp ".:${MYLIB_CLASSPATH}:${SWIFTKIT_CLASSPATH}" \
32+
-Djava.library.path="${SWIFT_LIB_PATHSSWIFT_LIB_PATHS}" \
33+
-cp "${CLASSPATH}" \
3034
Example
501 KB
Binary file not shown.

0 commit comments

Comments
 (0)