diff --git a/Package.swift b/Package.swift index 96a3844..94cb216 100644 --- a/Package.swift +++ b/Package.swift @@ -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"]), @@ -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", diff --git a/Sources/SkipBridge/Skip/skip.yml b/Sources/SkipBridge/Skip/skip.yml index 96972f2..8e8db63 100644 --- a/Sources/SkipBridge/Skip/skip.yml +++ b/Sources/SkipBridge/Skip/skip.yml @@ -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`: # :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