Skip to content

Commit

Permalink
Swift migration: merge changes from main (#665)
Browse files Browse the repository at this point in the history
* Create CODE_OF_CONDUCT.md (#589)

Resolves #588

* Update issue templates (#537)

* Update issue templates

Looks like GitHub wants this named differently 🤷‍♂️

* Delete migration_task.md

* Update custom.md

* Update README.md (#636)

Just removing the outdated image on the readme

* ETags support (#509)

* identity v3: public-facing changes (#453)

* re-added the public-facing changes for identity v3

* updated nullability for errors in login

* temporarily removed version from PurchasesCoreSwift in Purchases.podspec

* updated sample app to use identity v3

* improved copy in RCPurchases.h

* Integration tests: Identity v3 test cases (#506)

* added extra test case for storekit tests

* added more test cases

* added a few more test cases

* slight cleanup

* added another, particularly gnarly test case

* updated test case name

* added another test case

* one more test case

* refactors and cleanups, made chained calls more reliable for one test case

* fixed name, added debug information to appUserIDs

* fixed issue with test clearing transactions when it shouldn't

* formatting

* code cleanup

* update call to replace api key and proxy url to catch issues if proxy url is empty

* updated syntax since lanes are executed in a block

* updated xcode and simulator versions for storekitTests

* updated syntax for setting log levels

* fixed fastlane changes that broke replace_in for storekit_tests

* update fastlane

* improvements from PR comments

* restricted storekit_tests to release tags and branches

* removed signing for storekittest app since it only runs in simulator

* removed storekitTestCertificate.cer since it's not needed, re-added tests just in case

* restricted storekit_tests to release branches and tags again now that they passed

* Bump addressable in /IntegrationTests/CocoapodsIntegration (#647)

Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/sporkmonger/addressable/releases)
- [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md)
- [Commits](sporkmonger/addressable@addressable-2.7.0...addressable-2.8.0)

---
updated-dependencies:
- dependency-name: addressable
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* remove unused typedef to fix build warning (#649)

* Release: 3.12.0 (#648)

* looks like in some rebase createAlias got un-deprecated, re-deprecated it

* updated changelog and version number to 3.12.0

* added missing PR for identity v3 in changelog

* added install swiflint step to more ci jobs

* fix typo in circleci config.yml

* updated the name of the swiftlint step in xcode so it's more obvious at first glance when it fails

* fixed an issue where a few targets wouldn't compile correctly when doing carthage archive because they were pointing to unreleased versions of Purchases.

* re-added the old carthage script for archives

* added `vendor` folder to excluded directories for swiftlint

* Preparing for next version (#656)

Co-authored-by: Andy Boedo <andresboedo@gmail.com>

* added swiftlint installation to all places that were missing it (#657)

* Release: 3.12.1 (#659)

* renamed eTagInResponse -> maybeEtagInResponse to resolve conflict in some versions of Xcode

* updated version number to 3.12.1 and changelog

* added `scan_derived_data` to excluded directories for swiftlint

* Preparing for next version (#661)

Co-authored-by: Distiller <distiller@static.38.39.178.68.cyberlynk.net>

* Fix: Calling `setDebugLogsEnabled(false)` enables debug logs when it should not (#663)

* fixed a bug where setting debugLogsEnabled = false would still set them to true

* cleanup: replaced if / else with ternary operator

* reverted changes in SystemInfo initialization

* format fixes

* removed rchttpRequest

* updated call in `buildTvWatchAndMacOS`: install-gems -> install-dependencies

* undo accidental whitespace

* deleted empty RCSystemInfo.m file

Co-authored-by: Joshua Liebowitz <taquitos@users.noreply.github.com>
Co-authored-by: Corey Rabazinski <6013553+CoreyRab@users.noreply.github.com>
Co-authored-by: Cesar de la Vega <cesarvegaro@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: revenuecat-ops <60164957+revenuecat-ops@users.noreply.github.com>
Co-authored-by: Distiller <distiller@static.38.39.178.68.cyberlynk.net>
  • Loading branch information
7 people authored Jul 21, 2021
1 parent 2921d82 commit b760f2a
Show file tree
Hide file tree
Showing 38 changed files with 717 additions and 103 deletions.
45 changes: 23 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ release-tags: &release-tags

version: 2.1
commands:
install-gems:
install-dependencies:
parameters:
directory:
type: string
Expand All @@ -40,6 +40,10 @@ commands:
key: v1-gem-cache-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Install swiftlint
command: brew install swiftlint

scan-and-archive:
parameters:
directory:
Expand All @@ -65,12 +69,12 @@ commands:
command: |
bundle exec fastlane archive
install-gems-scan-and-archive:
install-dependencies-scan-and-archive:
parameters:
directory:
type: string
steps:
- install-gems:
- install-dependencies:
directory: << parameters.directory >>
- scan-and-archive:
directory: << parameters.directory >>
Expand All @@ -87,16 +91,15 @@ commands:
update-spm-integration-commit:
steps:
- install-gems
- install-dependencies
- run:
name: Update git commit in SPM package
working_directory: IntegrationTests/SPMIntegration/
name: Update git commit in targets that use SPM for dependencies
command: |
bundle exec fastlane update_swift_package_commit
update-carthage-integration-commit:
steps:
- install-gems
- install-dependencies
- run:
name: Update git commit in Carthage Integration tests
working_directory: IntegrationTests/CarthageIntegration/
Expand All @@ -112,7 +115,7 @@ jobs:
steps:
- checkout

- install-gems
- install-dependencies

- run:
name: Run tests
Expand All @@ -134,7 +137,7 @@ jobs:
- run:
name: Install swiftlint
command: brew install swiftlint
- install-gems
- install-dependencies
- run:
name: Build AppleTV, WatchOS, and macOS
command: bundle exec fastlane build_tv_watch_mac
Expand All @@ -158,15 +161,15 @@ jobs:
- checkout
- run:
name: Open simulator
command: xcrun instruments -w "iPhone 11 Pro (14.2) [" || true
command: xcrun instruments -w "iPhone 11 Pro (14.5) [" || true

- install-gems
- install-dependencies

- run:
name: Run StoreKit Tests
command: bundle exec fastlane storekit_tests
environment:
SCAN_DEVICE: iPhone 11 Pro (14.2)
SCAN_DEVICE: iPhone 11 Pro (14.5)
- store_test_results:
path: fastlane/test_output
- store_artifacts:
Expand Down Expand Up @@ -213,7 +216,7 @@ jobs:
shell: /bin/bash --login -o pipefail
steps:
- checkout
- install-gems
- install-dependencies
- run:
name: Build docs
command: bundle exec fastlane run jazzy
Expand Down Expand Up @@ -247,7 +250,7 @@ jobs:
shell: /bin/bash --login -o pipefail
steps:
- checkout
- install-gems
- install-dependencies
- trust-github-key
- run:
name: Prepare next version
Expand All @@ -261,8 +264,8 @@ jobs:
steps:
- checkout

- install-gems
- install-gems:
- install-dependencies
- install-dependencies:
directory: IntegrationTests/CocoapodsIntegration

- run:
Expand All @@ -283,7 +286,7 @@ jobs:
- checkout
- trust-github-key
- update-spm-integration-commit
- install-gems-scan-and-archive:
- install-dependencies-scan-and-archive:
directory: IntegrationTests/SPMIntegration/

integration-tests-carthage:
Expand Down Expand Up @@ -313,7 +316,7 @@ jobs:
paths:
- Carthage

- install-gems-scan-and-archive:
- install-dependencies-scan-and-archive:
directory: IntegrationTests/CarthageIntegration/

integration-tests-xcode-direct-integration:
Expand All @@ -324,7 +327,7 @@ jobs:
steps:
- checkout

- install-gems-scan-and-archive:
- install-dependencies-scan-and-archive:
directory: IntegrationTests/XcodeDirectIntegration/

lint:
Expand All @@ -334,9 +337,7 @@ jobs:
shell: /bin/bash --login -o pipefail
steps:
- checkout
- run:
name: Install swiftlint
command: brew install swiftlint
- install-dependencies
- run:
name: Run fastlane swiftlint lane
command: fastlane run swiftlint raise_if_swiftlint_error:true strict:true
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: Bug report
about: Filling a bug report
title: ""
title: ''
labels: bug
assignees: ""
assignees: ''

---

- [ ] I have updated Purchases SDK to the latest version
Expand Down
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Swift Migration Task
about: For use when creating issues for any work relating to our Swift migration.
title: ''
labels: swift migration
assignees: ''

---

Please add screenshots, links to code, any relevant information, and then add any relevant tag, e.g.:
"Test backfill" for when more tests are needed, or "you can do this" for things that don't need any extra context and are good issues for new folks to help out with.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/migration_task.md

This file was deleted.

4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ objc: true
sdk: iphonesimulator
module: Purchases
umbrella_header: Purchases/Public/Purchases.h
module_version: 3.12.0-SNAPSHOT
module_version: 3.13.0-SNAPSHOT
github_url: https://github.com/revenuecat/purchases-ios
github_file_prefix: https://github.com/revenuecat/purchases-ios/tree/3.12.0-SNAPSHOT
github_file_prefix: https://github.com/revenuecat/purchases-ios/tree/3.13.0-SNAPSHOT
output: docs
# Leaving this commented out. We used to specify this before, but now it's working without it
# xcodebuild_arguments: [--objc,Purchases/Public/Purchases.h,--,-x,objective-c,-isysroot,$(xcrun --show-sdk-path),-I,$(pwd)]
3 changes: 2 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ excluded:
- StoreKitTests
- PublicSDKAPITester
- vendor
- scan_derived_data
disabled_rules:
- trailing_comma
- todo
Expand All @@ -22,4 +23,4 @@ opt_in_rules:
identifier_name:
max_length:
warning: 60
error: 80
error: 80
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.0-SNAPSHOT
3.13.0-SNAPSHOT
6 changes: 2 additions & 4 deletions CHANGELOG.latest.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- Updates log message for `createAlias` to improve clarity
https://github.com/RevenueCat/purchases-ios/pull/498
- Adds `rc_` to all Foundation extensions to prevent name collisions
https://github.com/RevenueCat/purchases-ios/pull/500
- Fixed an issue in some versions of Xcode where compiling would fail with `Definition conflicts with previous value` in `ETagManager.swift`
https://github.com/revenuecat/purchases-ios/pull/659
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
## 3.12.1
- Fixed an issue in some versions of Xcode where compiling would fail with `Definition conflicts with previous value` in `ETagManager.swift`
https://github.com/revenuecat/purchases-ios/pull/659

## 3.12.0

### Identity V3:

#### New methods
- Introduces `logIn`, a new way of identifying users, which also returns whether a new user has been registered in the system.
`logIn` uses a new backend endpoint.
- Introduces `logOut`, a replacement for `reset`.

#### Deprecations
- deprecates `createAlias` in favor of `logIn`
- deprecates `identify` in favor of `logIn`
- deprecates `reset` in favor of `logOut`
- deprecates `allowSharingAppStoreAccount` in favor of dashboard-side configuration

https://github.com/RevenueCat/purchases-ios/pull/453
https://github.com/RevenueCat/purchases-ios/pull/438
https://github.com/RevenueCat/purchases-ios/pull/506


### Other changes:

#### Public additions
##### SharedPurchases nullability
- Fixed `sharedPurchases` nullability
- Introduced new property, `isConfigured`, that can be used to check whether the SDK has been configured and `sharedPurchases` won't be `nil`.
https://github.com/RevenueCat/purchases-ios/pull/508

##### Improved log handling
- Added new property `logLevel`, which provides more granular settings for the log level. Valid values are `debug`, `info`, `warn` and `error`.
- Added new method, `setLogHandler`, which allows developers to use their own code to handle logging, and integrate their existing systems.
https://github.com/RevenueCat/purchases-ios/pull/481
https://github.com/RevenueCat/purchases-ios/pull/515


#### Deprecations
- Deprecated `debugLogsEnabled` property in favor of `LogLevel`. Use `Purchases.logLevel = .debug` as a replacement.

#### Other

- Fixed CI issues with creating pull requests
https://github.com/RevenueCat/purchases-ios/pull/504
- Improved Github Issues bot behavior
https://github.com/RevenueCat/purchases-ios/pull/507
- Added e-tags to reduce network traffic usage
https://github.com/RevenueCat/purchases-ios/pull/509
- Fixed a warning in Xcode 13 with an outdated path in Package.swift
https://github.com/RevenueCat/purchases-ios/pull/522
- Switched to Swift Package Manager for handling dependencies for test targets.
https://github.com/RevenueCat/purchases-ios/pull/527
- Removed all `fatalError`s from the codebase
https://github.com/RevenueCat/purchases-ios/pull/529
https://github.com/RevenueCat/purchases-ios/pull/527
- Updated link for error message when UserDefaults are deleted outside the SDK
https://github.com/RevenueCat/purchases-ios/pull/531
- Improved many of the templates and added `CODE_OF_CONDUCT.md` to make contributing easier
https://github.com/RevenueCat/purchases-ios/pull/534
https://github.com/RevenueCat/purchases-ios/pull/537
https://github.com/RevenueCat/purchases-ios/pull/589

## 3.11.1
- Updates log message for `createAlias` to improve clarity
https://github.com/RevenueCat/purchases-ios/pull/498
Expand Down
Loading

0 comments on commit b760f2a

Please sign in to comment.