Skip to content

[WIP] Separate ReceiptParser SPM Package#2096

Closed
NachoSoto wants to merge 1 commit into
mainfrom
receipt-parser-spm-3
Closed

[WIP] Separate ReceiptParser SPM Package#2096
NachoSoto wants to merge 1 commit into
mainfrom
receipt-parser-spm-3

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Nov 28, 2022

Copy link
Copy Markdown
Contributor

Fixes CSDK-17.

This has some drawbacks and it's not as nice as having an isolated package, but it's A LOT simpler than the approach in #2062.

What's new:

  • New package can be built separately: swift build --target ReceiptParser
  • The package can be used separately when integrating in Xcode:
    Screenshot 2022-11-29 at 09 29 10
  • New target and scheme allows building directly from Xcode:
    Screenshot 2022-11-28 at 14 38 19
    Screenshot 2022-11-28 at 14 35 56
  • New CI job to ensure package aways builds

TODO:

  • Figure out overlapping sources (fixed it by creating a symlink)
  • Add scheme to be able to build new package from Xcode
  • Extract LoggerType: Extracted LoggerType #2098
  • Make types public
  • Document public methods
  • Document new ReceiptParser Package exists
  • Add new API to APITesters
    - [ ] Expose to Obj-C
  • Add Installation test
  • Change installation test reference back to main
  • Verify Carthage integration still works
  • Verify release-checks all pass

@NachoSoto NachoSoto added WIP pr:feat A new feature labels Nov 28, 2022
@NachoSoto NachoSoto requested a review from a team November 28, 2022 22:29
Comment thread LocalReceiptParsing Outdated

@NachoSoto NachoSoto Nov 28, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Symlink hack FTW.
This was the only way to avoid swift build failing because there are overlapping sources.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do docC docs continue to render well after this change? Asking because I ran into some issues with folder structure before and that's why I ended up having a Sources folder in the first place (although it also happened to be a good thing)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Docs are WIP, but yeah:
Screenshot 2022-12-14 at 11 10 04

At least these docs are generated correctly for the Purchases package. Not sure about the ReceiptParser package but if this doesn't work I'd be out of ideas :/

@NachoSoto NachoSoto force-pushed the receipt-parser-spm-3 branch 9 times, most recently from 310f48b to 47e0ff0 Compare December 5, 2022 17:59
@aboedo

aboedo commented Dec 7, 2022

Copy link
Copy Markdown
Member

nice work on this! Perhaps for the sake of shipping and iterating, we could split this into one PR for a public API to get the parsed receipt + one for the SPM and target changes?

@NachoSoto

Copy link
Copy Markdown
Contributor Author

we could split this into one PR for a public API to get the parsed receipt + one for the SPM and target changes?

Yeah that's my plan 👍🏻

@NachoSoto NachoSoto force-pushed the receipt-parser-spm-3 branch 6 times, most recently from 8c2de33 to 262b137 Compare December 14, 2022 20:08
@NachoSoto

NachoSoto commented Dec 14, 2022

Copy link
Copy Markdown
Contributor Author

Reopened this as #2153 and #2155.

@NachoSoto NachoSoto closed this Dec 14, 2022
NachoSoto added a commit that referenced this pull request Dec 22, 2022
Finishes [CSDK-17].
Follow up to #2153. Extracted from #2096.

### Changes:
- Created target in `Package.swift`. It can be built separately: `swift
build --target ReceiptParser`
![Screenshot 2022-11-29 at 09 29
10](https://user-images.githubusercontent.com/685609/204600321-9c99958c-a683-4b59-8334-df1cf1235d1d.png)
- Created `ReceiptParser` target in project:
![Screenshot 2022-12-14 at 13 56
38](https://user-images.githubusercontent.com/685609/207723593-40535089-1436-4b62-81cc-d098d589f83a.png)
- Added `ReceiptParser` scheme to allow building the target from Xcode:
![Screenshot 2022-12-14 at 13 57
02](https://user-images.githubusercontent.com/685609/207723665-dace0aa1-4ae7-4382-895f-908f356043b4.png)
- Added CI `spm-receipt-parser` job
- Added CI `installation-tests-receipt-parser` job
- Added `ReceiptParserAPITester` to test API for `ReceiptParser`'s
target
- Compile `ReceiptParserAPITester` when running `RevenueCat` tests so
these are validated as well. -

[CSDK-17]:
https://revenuecats.atlassian.net/browse/CSDK-17?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@NachoSoto NachoSoto deleted the receipt-parser-spm-3 branch May 26, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants