PostHog / posthog-ios

PostHog iOS SDK
https://posthog.com/docs/libraries/ios
MIT License
32 stars 41 forks source link

Swift package management work #10

Closed fuziontech closed 3 years ago

fuziontech commented 3 years ago

What does this PR do? Fixes a few bugs that kept swift package management fail

Where should the reviewer start? In the files that changed ;)

Give it a try. Try to add this branch as a dep using swift package management from xcode.

How should this be manually tested? Try to add this branch as a dep using swift package management from xcode.

Any background context you want to provide? Swift package management is quickly becoming the future of managing deps in apple development. Good to enable this for our ios users.

What are the relevant tickets?

1

Screenshots or screencasts (if UI/UX change)

Questions:

fuziontech commented 3 years ago

I did this over break and thought I had put up a PR for it. I use my forked library on a toy app I also built over break. Works great!

mariusandra commented 3 years ago

If it works great, then I have no problem merging! :)

mariusandra commented 3 years ago

I am getting errors like this when I try to publish the package though:

Validating podspec
 -> PostHog (1.2.2)
    - WARN  | url: The URL (https://twitter.com/PostHogHQ) is not reachable.
    - ERROR | xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Building targets in parallel
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'App' from project 'App')
    - NOTE  | xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
    - ERROR | xcodebuild:  PostHog/PostHog/Classes/Internal/PHGPostHogUtils.h:2:9: error: '../PHGSerializableValue.h' file not found, did you mean 'PHGSerializableValue.h'?
    - NOTE  | xcodebuild:  PostHog/PostHog/Classes/PHGPostHog.h:4:9: fatal error: 'Crypto/PHGCrypto.h' file not found
    - ERROR | xcodebuild:  PostHog/PostHog/Classes/Internal/PHGStoreKitCapturer.h:3:9: error: '../PHGPostHog.h' file not found, did you mean 'PHGPostHog.h'?
    - ERROR | xcodebuild:  PostHog/PostHog/Classes/Internal/PHGHTTPClient.h:2:9: error: '../PHGPostHog.h' file not found, did you mean 'PHGPostHog.h'?
    - NOTE  | xcodebuild:  PostHog/PostHog/Classes/Internal/PHGStorage.h:2:9: fatal error: '../Crypto/PHGCrypto.h' file not found
    - ERROR | xcodebuild:  PostHog/PostHog/Classes/Payloads/PHGPayload.h:2:9: error: '../PHGSerializableValue.h' file not found, did you mean 'PHGSerializableValue.h'?
    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'PostHog' from project 'Pods')

Can you explain what's the case with changing the paths? I could fix those errors, but will it mess something up for swift?

mariusandra commented 3 years ago

So I reverted the imports, hoping that won't mess up anything, and released 1.2.2 (, and used the oxford comma).