Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let package = Package(
name: "skip-bridge",
platforms: [.iOS(.v16), .macOS(.v13)],
products: [
.library(name: "SkipBridge", type: .dynamic, targets: ["SkipBridge"]),
.library(name: "SkipBridge", targets: ["SkipBridge"]),
.library(name: "SkipBridgeToKotlinSamples", type: .dynamic, targets: ["SkipBridgeToKotlinSamples"]),
.library(name: "SkipBridgeToKotlinSamplesHelpers", type: .dynamic, targets: ["SkipBridgeToKotlinSamplesHelpers"]),
.library(name: "SkipBridgeToKotlinCompatSamples", type: .dynamic, targets: ["SkipBridgeToKotlinCompatSamples"]),
Expand All @@ -17,7 +17,8 @@ let package = Package(
.package(url: "https://source.skip.tools/skip.git", from: "1.2.22"),
.package(url: "https://source.skip.tools/skip-lib.git", from: "1.3.2"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.2.12"),
.package(url: "https://source.skip.tools/swift-jni.git", "0.0.0"..<"2.0.0"),
//.package(url: "https://source.skip.tools/swift-jni.git", "0.0.0"..<"2.0.0"),
.package(url: "https://source.skip.tools/swift-jni.git", branch: "no-dynamic"),
],
targets: [
.target(name: "SkipBridge",
Expand Down
5 changes: 2 additions & 3 deletions Sources/SkipBridge/Skip/skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ build:
# the -module-cache-path and -no-clang-module-breadcrumbs flag is needed to avoid this sort of error with `skip export`:
# <unknown>:0: error: PCH was compiled with module cache path '/opt/src/github/skiptools/skip-bridge/.build/plugins/outputs/skip-bridge/SkipBridgeToSwiftSamples/destination/skipstone/SkipBridgeToSwiftSamplesHelpers/build/swift/aarch64-unknown-linux-android24/debug/ModuleCache/336QL0GS3Q4T0', but the path is currently '/opt/src/github/skiptools/skip-bridge/.build/plugins/outputs/skip-bridge/SkipBridgeToSwiftSamplesTestsSupport/destination/skipstone/SkipBridgeToSwiftSamplesHelpers/build/swift/aarch64-unknown-linux-android24/debug/ModuleCache/336QL0GS3Q4T0'
- 'workingDir(layout.projectDirectory)'
### FIXME: remove patchelf libc++_shared.so
# need to add log or else: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__android_log_print" referenced by "/data/app/~~JPhKFQv8tRivw49s0gKvYg==/skip.integ.demo.test-VvgNyXBxSCwAYbCiPaPtCA==/base.apk!/lib/arm64-v8a/libSkipIntegDemo.so"...
#- 'commandLine("sh", "-cx", "${skipcmd} android build -d ${swiftBuildFolder()}/jni-libs --package-path ${swiftSourceFolder()} --configuration ${swiftBuildConfig} --product ${project.name} --scratch-path ${swiftBuildFolder()}/swift --aggregate --arch automatic -Xcc -fPIC -Xswiftc -DSKIP_BRIDGE -Xswiftc -DTARGET_OS_ANDROID -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs -Xswiftc -Xfrontend -Xswiftc -module-cache-path -Xswiftc -Xfrontend -Xswiftc ${swiftBuildFolder()}/swift/module-cache/${project.name} && patchelf --add-needed libc++_shared.so --add-needed liblog.so ${swiftBuildFolder()}/jni-libs/*/lib${project.name}.so")'
- 'commandLine("sh", "-cx", "${skipcmd} android build -d ${swiftBuildFolder()}/jni-libs --package-path ${swiftSourceFolder()} --configuration ${swiftBuildConfig} --product ${project.name} --scratch-path ${swiftBuildFolder()}/swift --arch automatic -Xcc -fPIC -Xswiftc -DSKIP_BRIDGE -Xswiftc -DTARGET_OS_ANDROID -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs -Xswiftc -Xfrontend -Xswiftc -module-cache-path -Xswiftc -Xfrontend -Xswiftc ${swiftBuildFolder()}/swift/module-cache/${project.name}")'
- 'commandLine("sh", "-cx", "${skipcmd} android build --aggregate --arch automatic -d ${swiftBuildFolder()}/jni-libs --package-path ${swiftSourceFolder()} --configuration ${swiftBuildConfig} --product ${project.name} --scratch-path ${swiftBuildFolder()}/swift -Xcc -fPIC -Xswiftc -lc++_shared -Xswiftc -llog -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs -Xswiftc -Xfrontend -Xswiftc -module-cache-path -Xswiftc -Xfrontend -Xswiftc ${swiftBuildFolder()}/swift/module-cache/${project.name}")'
#- 'commandLine("sh", "-cx", "${skipcmd} android build -d ${swiftBuildFolder()}/jni-libs --package-path ${swiftSourceFolder()} --configuration ${swiftBuildConfig} --product ${project.name} --scratch-path ${swiftBuildFolder()}/swift --arch automatic -Xcc -fPIC -Xswiftc -DSKIP_BRIDGE -Xswiftc -DTARGET_OS_ANDROID -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs -Xswiftc -Xfrontend -Xswiftc -module-cache-path -Xswiftc -Xfrontend -Xswiftc ${swiftBuildFolder()}/swift/module-cache/${project.name}")'
- 'environment("SKIP_BRIDGE", "1")'
- 'environment("TARGET_OS_ANDROID", "1")'
# for local transpiler development, we need to ensure that the tool we are using is the locally-built skip, and not the one that is downloaded from the binary package
Expand Down