-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix static linking cocoapods #1888
Changes from all commits
ec1fcdc
ca4f591
ecd649a
6167dae
8367e74
f00f3c0
e8d2a63
20d904e
bc94224
e98278e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,16 @@ extension Bundle { | |
#if SWIFT_PACKAGE | ||
return Bundle.module | ||
#else | ||
return Bundle(for: BundleLocator.self) | ||
// When using frameworks this bundle will be our `.framework` bundle. | ||
// When using static linking this bundle will be the the host application's `.app` bundle. | ||
let bundle = Bundle(for: BundleLocator.self) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically, this bundle will be used only for binary distribution, right? I mean, for spm the module bundle will be used, for cocoapods, it will be the MapboxMapsResources.bundle, but for binary distribution we still need BundleLocator. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly! |
||
|
||
// When using CocoaPods a "resource bundle" will be used to avoid resource conflicts with the host application. | ||
// Check for the existence of the resource bundle and use that instead if it is present. | ||
let resourceBundle = bundle.path(forResource: "MapboxMapsResources", ofType: "bundle") | ||
.flatMap(Bundle.init(path:)) | ||
|
||
return resourceBundle ?? bundle | ||
#endif | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a TODO to remove this when cocoapods 1.12 is released, they fixed this issue CocoaPods/CocoaPods#11723