Mapbox-gl-native: Swift Package Manager

Created on 29 Jul 2019  路  11Comments  路  Source: mapbox/mapbox-gl-native

Hello!

Can you add support for Swift Package Manager?
It is quite popular and promoted by Apple dependency manager and would be great if you add it.

Thanks!

build feature iOS

Most helpful comment

馃憢 @1ec5 Just wondering if there's been any movement on this topic since July? Now that Xcode 11 has native support for Swift Package Manager it's the de facto "Apple approved way" to include 3rd party libraries like Mapbox. It looks like dependencies are now supported (according to Apple's docs -- see link below). I'm admittedly out of date as the current state of the Mapbox iOS ecosystem so I don't know if this is possible at this time, but based on where Apple is going it seems like something that Mapbox should support sooner rather than later. Thoughts?

https://developer.apple.com/documentation/swift_packages/creating_a_swift_package_with_xcode

All 11 comments

Hi @dmertsalov - thanks for the feature request! This is something that we're investigating, but we don't have an ETA for this currently.

/cc @frederoni

We have begun to support SPM in some of our Swift libraries: mapbox/MapboxStatic.swift#96 mapbox/MapboxDirections.swift#234 mapbox/MapboxGeocoder.swift#132 mapbox/mapbox-speech-swift#25 mapbox/turf-swift#30.

However, I don鈥檛 see a straightforward way for the map and navigation SDKs to be distributed via SPM at the moment. SPM doesn鈥檛 yet support binary dependencies. Until it does, the map SDK and its dependencies (MapboxAccounts and MapboxMobileEvents) would have to be built from source, but SPM also doesn鈥檛 allow resources to be included in targets. Perhaps there are workarounds for either issue though.

馃憢 @1ec5 Just wondering if there's been any movement on this topic since July? Now that Xcode 11 has native support for Swift Package Manager it's the de facto "Apple approved way" to include 3rd party libraries like Mapbox. It looks like dependencies are now supported (according to Apple's docs -- see link below). I'm admittedly out of date as the current state of the Mapbox iOS ecosystem so I don't know if this is possible at this time, but based on where Apple is going it seems like something that Mapbox should support sooner rather than later. Thoughts?

https://developer.apple.com/documentation/swift_packages/creating_a_swift_package_with_xcode

@1ec5 any updates here since July?

SPM doesn鈥檛 yet support binary dependencies. Until it does, the map SDK and its dependencies (MapboxAccounts and MapboxMobileEvents) would have to be built from source

As of mapbox/mapbox-gl-native-ios#60, the map SDK's MapboxMobileEvents dependency is built from source. However, as a closed-source library, MapboxAccounts needs to continue to be pulled in as a binary, whether we statically or dynamically link it into the map SDK.

@julianrex, are the steps to building the map SDK from source similar with SPM as with Carthage (mapbox/mapbox-gl-native-ios#133)? For MapboxAccounts, @alfwatt @frederoni have mused about a Run Script build phase that would take the place of any dependency manager鈥檚 transitive dependency functionality.

@1ec5 Hi! Any updates since Binary Dependencies are now officially supported by SPM in Swift 5.3 and Xcode 12? Thank you so much!

Is there any update incoming? Or is this issue gone cold? Because I'm holding of the Carthage integration for now.

Any updates about this? Should now be possible with swift-tools-version:5.3 and Xcode 12.

Any news? We would love to fully migrate from CocoaPods soon and Mapbox is one of the last libraries with missing support.

Thank you for your continued patience. We are tracking on addition of netrc support with SPM and working on our timeline for adding support.

Any news? We would love to fully migrate from CocoaPods soon and Mapbox is one of the last libraries with missing support.

Same in our case, the only library that did not support SPM yet. We fully switched to SPM now, except Mapbox as it works with Carthage.

Was this page helpful?
0 / 5 - 0 ratings