Skip to content
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

Support for Swift Package Manager #462

Closed
emrekyv opened this issue Jun 13, 2019 · 40 comments
Closed

Support for Swift Package Manager #462

emrekyv opened this issue Jun 13, 2019 · 40 comments

Comments

@emrekyv
Copy link

emrekyv commented Jun 13, 2019

With iOS support for Swift Package Manager in Xcode 11, is there a way to get that added to the project?

@demerino
Copy link
Member

This is something that we're looking into and hope to have support for it.

@patchthecode
Copy link

Any update on this?
Its pretty easy to add support for this. Simple add your code to a folder called Sources, and the add the Package.swift file. Would really be nice to have this

@scannillo
Copy link
Contributor

Hi @patchthecode. This is something on our future roadmap, however its priority is currently TBD.

@scannillo
Copy link
Contributor

Will leave this open to update once we get closer to its release.

@scannillo scannillo reopened this Jul 29, 2019
@jeffc-dev
Copy link

Is this something you'd accept a pull request for? It's pretty easy to add support for.

Xcode 11 is out and SwiftPM is now the "officially recommended" way of handling dependencies for iOS apps. We're currently working to migrate our existing code (and 3rd party code) as soon as possible.

@scannillo
Copy link
Contributor

Hi @jeffc-dev. I understand your concern and will re-ignite the conversation on our end.

We would definitely encourage a pull request!

@ethanwa
Copy link

ethanwa commented Sep 14, 2019

I would love to see this as well, thank you!

@pcabfever
Copy link

Any updates on this? I would be awesome to have this

@sestevens
Copy link
Contributor

Hey @pcabfever 👋 We would definitely like to offer support for SPM at some point in the future, but we're juggling a few other priorities right now, so I can't give you a specific timeline for when it will be available. Since parts of the Braintree SDK depend on prebuilt binaries, we need to look into whether we can create a Swift package with a subset of the SDK's functionality. Otherwise, we may need to wait for support for prebuilt binaries to be added to Swift Package Manager.

@jamesyorke
Copy link

Any movement on this? Fingers crossed for some good news

@sestevens
Copy link
Contributor

Hi @jamesyorke. We don't have much of an update at this point. We will most likely wait until prebuilt binaries can be added to SPM before we add support for it. We definitely plan to support Swift Package Manager in the future, though.

@thisolivier
Copy link

thisolivier commented Mar 16, 2020

@sestevens Really glad to have an update. That said, given PayPal's clout, could Braintree look into sponsoring those binaries being published on SPM? Continuing to rely on CocoaPods is painful, and really at odds with Braintree's 'modern' sell.

@demerino
Copy link
Member

@thisolivier We can raise the issue again with our partners that own those binaries. Similarly, we'll keep an eye out for any updates to SPM/Xcode that would make it possible for us to support SPM.

We share your frustration and as we consider a major version bump we will revisit our SDK design to see if we can find a good solve for this if the prebuilt binary story doesn't budge.

@jeffc-dev
Copy link

As a point of background for people asking about this.

Swift Package Manager currently only supports source-only packages. Binaries (ie. frameworks) are not supported.

It seems that the issue is that Braintree has closed-source code that they depend on in order to provide their functionality, and that is the hold-up. If this is the issue, their hands are tied.

There is a Swift-Evolution proposal for binary support in SPM, but this is not supported yet in shipping versions.

https://github.com/apple/swift-evolution/blob/master/proposals/0272-swiftpm-binary-dependencies.md

It sounds like progress is being made, however, and this SPM feature will likely land soon:

https://forums.swift.org/t/accepted-with-modifications-se-0272-package-manager-binary-dependencies/31926

My hope is that this will clear up the logjam and allow Braintree to proceed (hopefully soon, as we're really pushing to move to SPM for all our dependencies).

@demerino
Copy link
Member

@jeffc-dev thank you for the clarification and references.

@ethanwa
Copy link

ethanwa commented Jun 26, 2020

Xcode 12 and Swift 5.3 (both available as dev betas) now include resource and closed-source binary support for SPM. Hopefully SPM can now be done for this?

https://www.hackingwithswift.com/articles/218/whats-new-in-swift-5-3

@eseay
Copy link

eseay commented Aug 27, 2020

Is there any update on the progress to move BT to Swift PM? Even if for the time being it were just on a side branch, since it's only supported for Swift 5.3, it would still be helpful.

@ethanwa
Copy link

ethanwa commented Sep 16, 2020

Xcode 12 is now out as of today. SPM should be possible with Braintree I'd think at this point.

@bofeizhu
Copy link

bofeizhu commented Sep 26, 2020

@sestevens @scannillo Any updae on this issue? Xcode 12 supports SPM with prebuild binary now. Here is the related WWDC session https://developer.apple.com/videos/play/wwdc2020/10147 BrainTree is the sole framework that blocks us from migrating to SPM at the moment.

@natanrolnik
Copy link

We're also willing to move to SPM. It already supports resources and prebuilt binaries.
Hopefully, it can come back to the top in the priorities for Braintree 🙏

@Dario-GoldenSpear
Copy link

We are also on the same boat, SPM support would be great!.

@joseantsm-gs
Copy link

Same here! We hope Braintree moves to SPM soon!

@scannillo
Copy link
Contributor

Hello everyone - we have been actively working on adding SPM support.

Though Swift 5.3 does bring support for binary dependencies to SPM, only the xcframework format is currently supported (see SE Proposal 0272). Two of the Braintree's dependencies (3DS and fraud detection) are not .xcframework binaries.

We have brought the issues to both of our partners. We will keep you posted!

@RamblinWreck77
Copy link

@scannillo Thanks for the update! My understanding (and I may be wrong here) is that 3DS is an optional component you can enable.

If that's the case would it be possible to have a "braintree core" without 3DS, enabling a basic integration sooner?

Fraud protection sounds a little bit more scary, so maybe that one is best to wait for :P

@kokluch
Copy link

kokluch commented Nov 17, 2020

Hi @scannillo would you have any news on this topic? Maybe an intermediate solution would be to provider Braintree as an xcframework itself. That's what we're doing while waiting for SPM support in an official release.

@scannillo
Copy link
Contributor

Hello @kokluch - we are actively working on SPM support. We plan to have a beta release of the SDK out soon with partial SPM support (while we wait for 2 of our 3rd party vendors to create xcframeworks).

We will look into creating a Braintree xcframework in the meantime, though. Thank you for the suggestion. We will keep you updated.

@kokluch
Copy link

kokluch commented Nov 17, 2020

@scannillo Thanks for news!

@sestevens
Copy link
Contributor

👋 Hi everyone,

We just released a beta version of the SDK that includes partial Swift Package Manager support. Please try it out and open a GitHub issue if you have any feedback!

Resources:

Thanks,
Braintree SDK Team

@francybiga
Copy link

Hi, when could be expect SPM support for the braintree-ios-drop-in SDK?

@scannillo
Copy link
Contributor

Hello @francybiga - SPM support for Drop-in is actively in development. You can stay tuned about it in the corresponding GitHub issue.

@eseay
Copy link

eseay commented Jan 14, 2021

Hey @scannillo - do you have any idea what the timeline for going from v5.0 Beta to v5.0 GM looks like? My team is generally averse to shipping things marked "Beta" into production, but we're at the same time quite eager to move this dependency out of Carthage and into SPM. If the "Beta" tag is there simply for the purposes of dependency management/version resolution stuff and the code is indeed ready for production use, however, just let me know. Thanks!

@scannillo
Copy link
Contributor

Hi @eseay - that is a good question, and thanks for bringing it up. We're planning to release a v5.0.0-beta2 in the coming weeks, which will have a few new SPM features and fixes.

We're using the "beta" tag to accurately describe the state of the release, and we will remove the "beta" tag when we feel it is production ready. We welcome your feedback though on the current beta implementations.

@sestevens
Copy link
Contributor

Support for Swift Package Manager has been added in version 5.0.0. See our Swift Package Manager guide for instructions and required workarounds.

Also, please see our migration guide for steps to upgrade your integration.

@aymenafia
Copy link

Hi,
import PPRiskMagnes is not found when i create archive, in the version 5.0.0 when i added brainTree by Swift Package Manager.

@sestevens
Copy link
Contributor

@aymenafia Did you follow the instructions in our Swift Package Manager guide about explicitly including binary dependencies (such as PPRiskMagnes)? You'll need to check the box for PPRiskMagnes when adding the Braintree frameworks to your project via Swift Package Manager.

If this doesn't resolve the problem, please open a new GitHub Issue with more details. Thanks!

@mbuchetics
Copy link

Is there any ETA when CardinalMobile.framework will be available via SPM and/or XCFramework as well? From what I can tell, there is currently no Apple Silicon Simulator support and it's the last remaining .framework in my project.

@sestevens
Copy link
Contributor

@mbuchetics Sorry, we don't have an ETA for an CardinalMobile .xcframework at this point. We know folks are eager to migrate fully to SPM and that our current workarounds are less than ideal.

You're correct that Cardinal's current .framework doesn't work on Apple Silicon simulators. We've requested both an .xcframework and a .framework with support for Apple Silicon simulators, and as soon as we receive one or both, we'll update the Braintree SDK as quickly as possible.

@sestevens
Copy link
Contributor

sestevens commented Mar 18, 2021

@mbuchetics We just received an xcframework from CardinalMobile today. We'll do our best to get a release for this out soon, but in the meantime you can check out the branch cardinal-xcframework or take a look at PR #649.

@sestevens
Copy link
Contributor

Unfortunately, CardinalMobile's xcframework doesn't appear to have support for Apple Silicon Simulators. We'll follow up with them on that.

@scannillo
Copy link
Contributor

Hello @mbuchetics - we just released v5.3.0 of the Braintree iOS SDK, which includes an xcframework for CardinalMobile. The integration steps for BraintreeThreeDSecure via SPM have been simplified, please see the instructions here.

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

No branches or pull requests