Carthage support would be great, but Carthage only supports dynamic frameworks at the moment, whereas this project's relatively complex build system puts out a static library. CocoaPods wraps this static library in a framework, which is how we support Swift. So if we can do something like that as part of the build process, we'd be able to support Carthage.
Dynamic framework is tracked in https://github.com/mapbox/mapbox-gl-native/issues/828.
carthage support would be great!
+1 on carthage support
For anyone interested in a temporary way to include Mapbox via Carthage until #828 is resolved, I've created a mirror using the Rome CocoaPods plugin at https://github.com/erichoracek/Mapbox.
Weâve begun to publish 3.1.0 prereleases with dynamic frameworks attached. However, there are a couple issues blocking Carthage adoption:
Itâs also unclear to me whether the existing package structure, which puts the dynamic framework in a dynamic/ folder, is compatible with Carthage.
According to https://github.com/Carthage/Carthage/issues/1056#issuecomment-174293745, the existing structure should be fine. We just need to publish a redundant copy of the â-dynamic.zipâ package with â.frameworkâ in the name.
Apparently Carthage considers _any_ tag that doesnât strictly conform to semver to meet the requirements specified in the Cartfile: Carthage/Carthage#469. Hopefully weâd get lucky because Android and Node releases have no â.frameworkâ assets.
IIRC, Carthage downloaded the Android release when I tried it a few days back (and Android was the most recent).
+1
Carthage/Carthage#722 would give us another way forward for this issue.
+1 Carthage
Carthage fundamentally isnât compatible with monorepos like this one. We could maintain a separate repository for iOS SDK releases along the lines of https://github.com/mapbox/mapbox-gl-native/issues/1623#issuecomment-161186752, but then why not split the iOS and macOS SDKsâ Objective-C codebase into a separate repo from the core mbgl project, as we originally did in mapbox-gl-cocoa?
Thanks for the heads-up, @erichoracek â we've added tentative support for Carthage. đ
Iâll leave this issue open for now so we can track how well this initial Carthage support works, and also as a reminder to add official documentation.
If youâre new to Carthage, follow these setup instructions.
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 3.4
_There is also a -symbols feed available._
Drag Mapbox.framework (located in Carthage/Build/iOS) into Linked Frameworks and Libraries.
Add this to your Carthage copy-frameworks build phase:
$(SRCROOT)/Carthage/Build/iOS/Mapbox.framework
== operator. Support is a work-in-progress in https://github.com/Carthage/Carthage/pull/1553. (Nonetheless, pre-releases are optimistically included in our feeds.)Please be sure to open a Carthage issue if you have any feedback about this feature!
I'm excited to see people adopting this feature. đ€
@mdiep, on behalf of all monorepoists out there, thank you. đ
The Mapbox macOS SDK supports Carthage through a setup workflow similar to the one in https://github.com/mapbox/mapbox-gl-native/issues/1623#issuecomment-280175923. Here are the general instructions for a macOS project, and here are the steps for the macOS SDK specifically:
binary "https://mapbox.github.io/mapbox-gl-native/macos/Mapbox-macOS-SDK.json" ~> 0.3
binary "https://mapbox.github.io/mapbox-gl-native/macos/Mapbox-macOS-SDK-symbols.json" ~> 0.3
Carthage/Build/Mac) into Linked Frameworks and Libraries.carthage copy-frameworks:
$(SRCROOT)/Carthage/Build/Mac/Mapbox.framework
Note that Carthage doesnât currently support prereleases, even when you use the == operator. The binary project specification includes prereleases in anticipation of Carthage/Carthage#1553.
Edit: Renamed the binary project specification from âcarthage.jsonâ to âMapbox-macOS-SDK.jsonâ.
iOS instructions are live at: https://www.mapbox.com/ios-sdk/
Fixed in #8257.
Most helpful comment
Thanks for the heads-up, @erichoracek â we've added tentative support for Carthage. đ
Iâll leave this issue open for now so we can track how well this initial Carthage support works, and also as a reminder to add official documentation.
How to use the Mapbox iOS SDK with Carthage
If youâre new to Carthage, follow these setup instructions.
_There is also a
-symbolsfeed available._Drag Mapbox.framework (located in
Carthage/Build/iOS) into Linked Frameworks and Libraries.Add this to your Carthage copy-frameworks build phase:
Caveats
==operator. Support is a work-in-progress in https://github.com/Carthage/Carthage/pull/1553. (Nonetheless, pre-releases are optimistically included in our feeds.)