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

modularization improvement: static dependency #319

Merged
merged 2 commits into from
Aug 26, 2020
Merged

Conversation

aboedo
Copy link
Member

@aboedo aboedo commented Aug 26, 2020

This makes a couple of updates to our modularization system:

  • PurchasesCoreSwift is now static instead of dynamic
  • Purchases uses the -all_load linker flag.

This makes it so that developers won't need to make any changes to their code in order to use the swift stuff, meaning that they don't have to manually link PurchasesCoreSwift or even know that it exists.

The changes here were inspired by this (excellent) blog entry that proposes a modularized structure for iOS apps:
https://medium.com/fluxom/building-a-dynamic-modular-ios-architecture-1b87dc31278b

Tested on:

  • manual dependency
  • carthage
  • swift package manager (changes shouldn't affect it anyway)
  • cocoapods (changes shouldn't affect it anyway)

Tested by running the app on physical device, calling methods from the SDK, in particular using the Transaction and `nonSubscriptionTransactions, since those were the problematic ones for #314.
As well as running the app on each package manager / build system, I also made an archive.

Requirements:

@aboedo aboedo requested a review from vegaro August 26, 2020 15:51
@aboedo aboedo self-assigned this Aug 26, 2020
// Copyright © 2020 Purchases. All rights reserved.
//

import Foundation
Copy link
Member Author

Choose a reason for hiding this comment

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

this file is needed so that Xcode can link swift stuff correctly for the static library dependency. Actually, I'll write that as a comment in the file in case anyone wonders in the future.

@aboedo aboedo added the HOLD label Aug 26, 2020
@aboedo aboedo mentioned this pull request Aug 26, 2020
1 task
Base automatically changed from binary_framework_2 to develop August 26, 2020 19:13
@aboedo aboedo merged commit e4b0e34 into develop Aug 26, 2020
@aboedo aboedo deleted the modularization_4 branch August 26, 2020 19:17
@aboedo aboedo mentioned this pull request Aug 27, 2020
@aboedo aboedo mentioned this pull request Sep 10, 2020
@aboedo aboedo mentioned this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant