diff --git a/Sources/PodToBUILD/Convertible/XCFramework.swift b/Sources/PodToBUILD/Convertible/XCFramework.swift index ed1a358..fbdc709 100644 --- a/Sources/PodToBUILD/Convertible/XCFramework.swift +++ b/Sources/PodToBUILD/Convertible/XCFramework.swift @@ -40,8 +40,13 @@ struct XCFramework: StarlarkConvertible { var input = try PropertyListDecoder().decode(InputData.self, from: data) input.AvailableLibraries = input.AvailableLibraries.map({ var lib = $0 - lib.path = xcframework.appendingPath($0.LibraryIdentifier).appendingPath($0.LibraryPath) - lib.linkage = $0.LibraryPath.hasSuffix("framework") ? .dynamic : .static + let path = xcframework.appendingPath($0.LibraryIdentifier).appendingPath($0.LibraryPath) + lib.path = path + if $0.LibraryPath.hasSuffix("framework") { + lib.linkage = isDynamicFramework(path, options: options) ? .dynamic : .static + } else { + lib.linkage = .static + } if lib.SupportedPlatformVariant == "simulator" && lib.SupportedPlatform == "ios" { lib.SupportedArchitectures = lib.SupportedArchitectures.map({ $0.replacingOccurrences(of: "arm64", with: "sim_arm64") diff --git a/Tests/Recorded/FirebaseAnalytics/BUILD.bazel b/Tests/Recorded/FirebaseAnalytics/BUILD.bazel index ac4af03..3fa7953 100644 --- a/Tests/Recorded/FirebaseAnalytics/BUILD.bazel +++ b/Tests/Recorded/FirebaseAnalytics/BUILD.bazel @@ -87,7 +87,7 @@ apple_framework( "slices": [ { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "macos-arm64_x86_64", @@ -101,7 +101,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "tvos-arm64", @@ -114,7 +114,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_x86_64-maccatalyst", @@ -128,7 +128,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_i386_x86_64-simulator", @@ -143,7 +143,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "tvos-arm64_x86_64-simulator", @@ -157,7 +157,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_armv7", diff --git a/Tests/Recorded/GoogleAppMeasurement/BUILD.bazel b/Tests/Recorded/GoogleAppMeasurement/BUILD.bazel index 0203be8..8ab42b1 100644 --- a/Tests/Recorded/GoogleAppMeasurement/BUILD.bazel +++ b/Tests/Recorded/GoogleAppMeasurement/BUILD.bazel @@ -83,7 +83,7 @@ apple_framework( "slices": [ { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "macos-arm64_x86_64", @@ -97,7 +97,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_i386_x86_64-simulator", @@ -112,7 +112,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "tvos-arm64", @@ -125,7 +125,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_armv7", @@ -139,7 +139,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_x86_64-maccatalyst", @@ -153,7 +153,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "tvos-arm64_x86_64-simulator", @@ -172,7 +172,7 @@ apple_framework( "slices": [ { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "tvos-arm64", @@ -185,7 +185,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "macos-arm64_x86_64", @@ -199,7 +199,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_i386_x86_64-simulator", @@ -214,7 +214,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "tvos-arm64_x86_64-simulator", @@ -228,7 +228,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_armv7", @@ -242,7 +242,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_x86_64-maccatalyst", diff --git a/Tests/Recorded/GoogleMaps/BUILD.bazel b/Tests/Recorded/GoogleMaps/BUILD.bazel index fdda7e2..41b3dd0 100644 --- a/Tests/Recorded/GoogleMaps/BUILD.bazel +++ b/Tests/Recorded/GoogleMaps/BUILD.bazel @@ -80,7 +80,7 @@ apple_framework( "slices": [ { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_x86_64-simulator", @@ -94,7 +94,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64", @@ -112,7 +112,7 @@ apple_framework( "slices": [ { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_x86_64-simulator", @@ -126,7 +126,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64", @@ -144,7 +144,7 @@ apple_framework( "slices": [ { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64_x86_64-simulator", @@ -158,7 +158,7 @@ apple_framework( }, { "build_type": { - "linkage": "dynamic", + "linkage": "static", "packaging": "framework" }, "identifier": "ios-arm64",