Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add support for Carthage #1623

Closed
Closed

Description

@barkoded

It would be wonderful if Mapbox GL for iOS would support Carthage as an alternative to Cocoapods.

Activity

  1. changed the title [-]Added support for Carthage[/-] [+]Add support for Carthage[/+] on May 22, 2015
  2. 1ec5 commented on May 22, 2015

    @1ec5
    Contributor

    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.

  3. incanus commented on May 22, 2015

    @incanus
    Contributor

    Dynamic framework is tracked in #828.

  4. added
    iOS
    on May 22, 2015
  5. alec-c4 commented on May 25, 2015

    @alec-c4

    carthage support would be great!

  6. petaren commented on Nov 11, 2015

    @petaren

    +1 on carthage support

  7. erichoracek commented on Dec 2, 2015

    @erichoracek
    Contributor

    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.

  8. added this to the ios-v3.2.0 milestone on Jan 21, 2016
  9. 1ec5 commented on Jan 30, 2016

    @1ec5
    Contributor

    We’ve begun to publish 3.1.0 prereleases with dynamic frameworks attached. However, there are a couple issues blocking Carthage adoption:

    • Carthage insists on a vX.Y.Z tag format, whereas the Mapbox iOS SDK’s tags are formatted ios-vX.Y.Z (with -pre.P appended for prereleases), in order to support independent versioning of the iOS, OS X, and Android SDKs and the Node module. Although we stopped using the vX.Y.Z format to tag the cross-platform mbgl code in this repository months ago, it doesn’t seem right to move iOS releases to that format when non-iOS releases share this repository.
    • Carthage looks for release attachments whose names contain “.framework”. It’s also unclear to me whether the existing package structure, which puts the dynamic framework in a dynamic/ folder, is compatible with Carthage.
  10. 1ec5 commented on Jan 30, 2016

    @1ec5
    Contributor

    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 Carthage/Carthage#1056 (comment), the existing structure should be fine. We just need to publish a redundant copy of the “-dynamic.zip” package with “.framework” in the name.

  11. 1ec5 commented on Jan 30, 2016

    @1ec5
    Contributor

    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.

  12. friedbunny commented on Feb 1, 2016

    @friedbunny
    Contributor

    IIRC, Carthage downloaded the Android release when I tried it a few days back (and Android was the most recent).

  13. maciekish commented on Mar 4, 2016

    @maciekish
    Contributor

    +1

  14. removed this from the ios-v3.3.0 milestone on Jun 28, 2016
  15. 4 remaining items

  16. modified the milestones: ios-future, ios-v3.4.0 on Jul 11, 2016
  17. 1ec5 commented on Jul 15, 2016

    @1ec5
    Contributor

    Carthage/Carthage#722 would give us another way forward for this issue.

  18. cansurmeli commented on Nov 14, 2016

    @cansurmeli

    +1 Carthage

  19. 1ec5 commented on Nov 16, 2016

    @1ec5
    Contributor

    Carthage fundamentally isn’t compatible with monorepos like this one. We could maintain a separate repository for iOS SDK releases along the lines of #1623 (comment), 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?

  20. erichoracek commented on Feb 15, 2017

    @erichoracek
    Contributor

    The most recent version of Carthage (0.19) has added support for binary downloads, e.g.:

    binary "https://my.domain.com/release/MyFramework.json"
    

    See the JSON file spec here.

    Is this something that could work for MBGL rather than a separate repo with releases?

  21. friedbunny commented on Feb 15, 2017

    @friedbunny
    Contributor

    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.

    1. Add this line to your Cartfile:
    binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 3.4
    

    There is also a -symbols feed available.

    1. Drag Mapbox.framework (located in Carthage/Build/iOS) into Linked Frameworks and Libraries.

    2. Add this to your Carthage copy-frameworks build phase:

    $(SRCROOT)/Carthage/Build/iOS/Mapbox.framework
    

    Caveats

  22. mdiep commented on Feb 16, 2017

    @mdiep

    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. 🤘

  23. friedbunny commented on Feb 16, 2017

    @friedbunny
    Contributor

    @mdiep, on behalf of all monorepoists out there, thank you. 😉

  24. added
    macOS
    on Feb 21, 2017
  25. 1ec5 commented on Feb 21, 2017

    @1ec5
    Contributor

    The Mapbox macOS SDK supports Carthage through a setup workflow similar to the one in #1623 (comment). Here are the general instructions for a macOS project, and here are the steps for the macOS SDK specifically:

    1. Add this binary project specification to your Cartfile:
      binary "https://mapbox.github.io/mapbox-gl-native/macos/Mapbox-macOS-SDK.json" ~> 0.3
      
      or this one, for debug symbols:
      binary "https://mapbox.github.io/mapbox-gl-native/macos/Mapbox-macOS-SDK-symbols.json" ~> 0.3
      
    2. Drag Mapbox.framework (located in Carthage/Build/Mac) into Linked Frameworks and Libraries.
    3. Add this path to the Input Files section of the Run Script build phase that runs 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”.

  26. friedbunny commented on Mar 1, 2017

    @friedbunny
    Contributor
  27. friedbunny commented on Mar 3, 2017

    @friedbunny
    Contributor

    Fixed in #8257.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildiOSmacOS

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions