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

Xcode 12.5 - Fix SPM binary dependency explicit requirement #636

Merged
merged 34 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a80f3dc
Move PPRiskMagnes and KountDataCollector to be targets of the PayPalD…
Feb 22, 2021
6d39c33
Keep KountDataCollector & PPRiskMagnes product libraries to maintain …
Feb 22, 2021
19e3b3f
Remove KountDataCollector and PPRiskMagnes public product libraries
Feb 22, 2021
388f242
Update README, SPM guide, and remove image asset
Feb 22, 2021
3ccc164
Update SPMTest sample app to no longer explicitly require PPRiskMagne…
Feb 22, 2021
45cf626
Update CHANGELOG
Feb 22, 2021
4ca816e
Bump GH actions to use xcode 12.5
Feb 22, 2021
8968262
Bump MacOS version in GH actions workflows to be 11.2
Feb 22, 2021
4117960
Update GH actions workflows to use MacOS 11.0; 11.2 isn't yet avilabl…
Feb 22, 2021
781e1ff
Remove SPMTest app Build post-action to remove duplicate Kount.a
Feb 22, 2021
f2c07c5
Update XCode version in release.yml
Feb 22, 2021
fb54f2f
Merge branch 'master' into spm-binary-fix-xcode12-5
May 7, 2021
8f13374
Merge branch 'master' into spm-binary-fix-xcode12-5
May 24, 2021
6c9ffe9
Merge branch 'master' into spm-binary-fix-xcode12-5
Jun 2, 2021
3d73438
Update SPMTest app to use CardinalMobile.xcframework
sestevens Jun 2, 2021
313ab30
Update Package.swift to remove explicit CardinalMobile library requir…
sestevens Jun 2, 2021
b1b9513
Update SPMTest app to no longer need CardinalMobile library explicitly
sestevens Jun 2, 2021
3865ef0
Update GH Actions yml files to revert to using Xcode12.4 (and older O…
sestevens Jun 2, 2021
c2d2c4b
Remove archive step from SPMTest app build command
Jun 2, 2021
c2a7a4c
Re-add code signing details in SPM build command
Jun 3, 2021
6ebfadf
Try GH Actions CI with MacOS11 & XCode12.5
Jun 7, 2021
8fa3631
Merge branch 'master' into spm-binary-fix-xcode12-5
Jun 22, 2021
f44df27
Add archive back to github actions SPM build and archive step
Jun 22, 2021
65c9e5f
Add back workarounds for older SDK versions to SWIFT_PACKAGE_MANAGER.md
Jun 22, 2021
8fc34b5
Clarify README & SPM guide instructions
Jun 22, 2021
ae79f18
Fixup - merge commit accidentally duplicated XCode fetch step in rele…
Jun 22, 2021
b75e663
Fixup - CHANGELOG
Jun 22, 2021
697a792
fixup - clarify Braintree versions required for each SPM instruction …
Jun 22, 2021
9c6ac12
Re-add kount_post_action.png image for README instructions
Jun 22, 2021
014cad0
Fix .md link typo
sarahkoop Jun 23, 2021
b092849
PR feedback
Jun 23, 2021
7338b1a
Merge branch 'master' into spm-binary-fix-xcode12-5
scannillo Jun 24, 2021
f57b5c3
Update CHANGELOG.md
scannillo Jun 24, 2021
88c7d5d
Update CHANGELOG.md
scannillo Jun 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unreleased
* Re-add `BraintreeCore` dependency to `PayPalDataCollector` for Swift Package Manager archive issue workaround (fixes #679)
* Remove SPM product libraries for `KountDataCollector` and `PPRiskMagnes` (this was a workaround for an Xcode bug discussed in #576; bug resolved in Xcode 12.5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Re-add `BraintreeCore` dependency to `PayPalDataCollector` for Swift Package Manager archive issue workaround (fixes #679)
* Remove SPM product libraries for `KountDataCollector` and `PPRiskMagnes` (this was a workaround for an Xcode bug discussed in #576; bug resolved in Xcode 12.5)
* Swift Package Manager
* Re-add `BraintreeCore` dependency to `PayPalDataCollector` for Swift Package Manager archive issue workaround (fixes #679)
* Remove SPM product libraries for `KountDataCollector` and `PPRiskMagnes` (this was a workaround for an Xcode bug discussed in #576; bug resolved in Xcode 12.5)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to group both of these under Swift Package Manager.

Also, maybe we should add a note in the changelog calling out that merchants using SPM can delete the Kount run script and remove the explicit dependencies on KountDataCollector and PPRiskMagnes?

And shouldn't CardinalMobile be listed here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good callouts - I made an update, let me know what you think!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!


## 5.4.0 (2021-06-07)
* Venmo
Expand Down Expand Up @@ -746,7 +747,7 @@ As always, feel free to [open an Issue](https://github.com/braintree/braintree_i
* Fix bug in Demo app
* Menu button now works correctly
* Fix bug with PayPal app switching
* The bug occurred when installing a new app after the Braintree SDK had been initialized. When attempting to authorize with PayPal in this scenario, the SDK would switch to the `wallet` and launch the `in-app` authorization.
* The bug occurred when installing a new app after the Braintree SDK had been initialized. When attempting to authorize with PayPal in this scenario, the SDK would switch to the `wallet` and launch the `in-app` authorization.

## 3.8.1 (2015-05-22)

Expand Down Expand Up @@ -837,11 +838,11 @@ As always, feel free to [open an Issue](https://github.com/braintree/braintree_i
* Update PayPal Mobile SDK to new version (PayPal-iOS-SDK 2.8.4-bt1) that does not include card.io.
* :rotating_light: Please note! :rotating_light:

This change breaks builds that depend on a workaround introduced in 3.4.0 that added card.io headers to fix [card.io duplicate symbol issues](https://github.com/braintree/braintree_ios/issues/53).
This change breaks builds that depend on a workaround introduced in 3.4.0 that added card.io headers to fix [card.io duplicate symbol issues](https://github.com/braintree/braintree_ios/issues/53).

Since card.io is not officially part of the Braintree API, and since the headers were only included as part of a workaround for use by a small group of developers, this potentially-breaking change is not accompanied by a major version release.
Since card.io is not officially part of the Braintree API, and since the headers were only included as part of a workaround for use by a small group of developers, this potentially-breaking change is not accompanied by a major version release.

If your build breaks due to this change, you can re-add card.io to your project's Podfile:
If your build breaks due to this change, you can re-add card.io to your project's Podfile:

pod 'CardIO', '~> 4.0'

Expand Down Expand Up @@ -897,7 +898,7 @@ As always, feel free to [open an Issue](https://github.com/braintree/braintree_i

* Upgrade PayPal Mobile SDK to version 2.7.1
* Fixes symbol conflicts with 1Password
* Upgrades embedded card.io library to version 3.10.1
* Upgrades embedded card.io library to version 3.10.1

## 3.4.1 (2014-11-05)

Expand Down Expand Up @@ -967,7 +968,7 @@ As always, feel free to [open an Issue](https://github.com/braintree/braintree_i
* Test improvements
* Internal API tweaks
* Update PayPal implementation to always support PayPal display email/phone across client and server
* Your PayPal app (client ID) must now have the email scope capability. This is default for Braintree-provisioned PayPal apps.
* Your PayPal app (client ID) must now have the email scope capability. This is default for Braintree-provisioned PayPal apps.
* Improved Braintree-Demo app that demonstrates many integration styles
* Upgraded underlying PayPal Mobile SDK

Expand Down
18 changes: 3 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let package = Package(
),
.library(
name: "BraintreeDataCollector",
targets: ["BraintreeDataCollector"]
targets: ["BraintreeDataCollector", "KountDataCollector"]
),
.library(
name: "BraintreePaymentFlow",
Expand All @@ -37,11 +37,7 @@ let package = Package(
),
.library(
name: "BraintreeThreeDSecure",
targets: ["BraintreeThreeDSecure"]
),
.library(
name: "CardinalMobile",
targets: ["CardinalMobile"]
targets: ["BraintreeThreeDSecure", "CardinalMobile"]
),
.library(
name: "BraintreeUnionPay",
Expand All @@ -51,17 +47,9 @@ let package = Package(
name: "BraintreeVenmo",
targets: ["BraintreeVenmo"]
),
.library(
name: "KountDataCollector",
targets: ["KountDataCollector"]
),
.library(
name: "PayPalDataCollector",
targets: ["PayPalDataCollector"]
),
.library(
name: "PPRiskMagnes",
targets: ["PPRiskMagnes"]
targets: ["PayPalDataCollector", "PPRiskMagnes"]
)
],
dependencies: [
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,20 @@ We recommend using [Swift Package Manager](https://swift.org/package-manager/),
### Swift Package Manager
_This feature is only available in v5._

See our [Swift Package Manager guide](https://github.com/braintree/braintree_ios/blob/master/SWIFT_PACKAGE_MANAGER.md) for instructions on integrating with SPM.
To add the `Braintree` package to your Xcode project, select _File > Swift Packages > Add Package Dependency_ and enter `https://github.com/braintree/braintree_ios` as the repository URL. Tick the checkboxes for the specific Braintree libraries you wish to include.

If you look at your app target, you will see that the Braintree libraries you chose are automatically linked as a frameworks to your app (see _General > Frameworks, Libraries, and Embedded Content_).

In your app's source code files, use the following import syntax to include Braintree's libraries:
```
import BraintreeCore
import BraintreeCard
import BraintreeApplePay
import BraintreePayPal
```

**Braintree 5.X.0 requires Xcode 12.5+ for SPM.** We recommend using the latest version for the simplest SPM integration. If using Braintree 5.X.0 and below, please see our [Swift Package Manager guide](https://github.com/braintree/braintree_ios/blob/master/SPM_BUGFIX_GUIDE.md) for specific workarounds required to use these older versions.


### CocoaPods
```
Expand Down
25 changes: 7 additions & 18 deletions SWIFT_PACKAGE_MANAGER.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
# Swift Package Manager Instructions
# Swift Package Manager Instructions (for Braintree 5.0.0 to 5.X.0)

Support for Swift Package Manager was introduced in Braintree iOS v5.
It is recommended to update to Braintree 5.X.0+ and Xcode 12.5 for the best SPM experience.

* [General Instructions](#general-instructions)
* [Binary Dependencies](#binary-dependencies)
* [BraintreeDataCollector](#braintreedatacollector)
* [BraintreeThreeDSecure](#braintreethreedsecure)

### General Instructions

To add the `Braintree` package to your Xcode project, select _File > Swift Packages > Add Package Dependency_ and enter `https://github.com/braintree/braintree_ios` as the repository URL. Tick the checkboxes for the specific Braintree libraries you wish to include.

If you look at your app target, you will see that the Braintree libraries you chose are automatically linked as a frameworks to your app (see _General > Frameworks, Libraries, and Embedded Content_).

In your app's source code files, use the following import syntax to include Braintree's libraries:
```
import BraintreeCore
import BraintreeCard
import BraintreeApplePay
import BraintreePayPal
```

### Binary Dependencies

#### Versions 5.0.0 to 5.X.0

There is a known Xcode bug, reported in [this GitHub issue](https://github.com/braintree/braintree_ios/issues/576), that occurs when archiving apps that include binary dependencies via SPM. The workaround is to tick the checkboxes to explicitly include these binary dependencies in your app.

To use the `BraintreeDataCollector` library, you must also check the box for `KountDataCollector`.
Expand All @@ -35,6 +22,8 @@ If your app uses app extensions, there is a [known SPM issue](https://forums.swi

### BraintreeDataCollector

#### Versions 5.0.0 to 5.X.0

There is a [known bug](https://forums.swift.org/t/packaging-static-library-in-spm-package-for-ios-executable/41245/13) that occurs when uploading static libraries packaged as xcframeworks for Swift Package Manager. To avoid this issue, you must add a post-action to your scheme's Build section that removes an extra copy of `libKountDataCollector.a`.


Expand All @@ -48,7 +37,7 @@ Make sure to select your app's target in the _Provide build settings from_ drop-

### BraintreeThreeDSecure

#### Versions 5.3.0+
#### Versions 5.3.0 to 5.X.0

If you are using `BraintreeThreeDSecure`, you must also explicitly include `CardinalMobile` and `PPRiskMagnes`, both of which can be included through SPM.

Expand Down
Loading