This is a special fork of Auth0.swift that (theoretically) supports Swift Package Manager 🎉😬
I say "theoretically" because so far I've only tested the iOS version in a real project (I was able to log in and get tokens etc, but definitely need to test everything else properly)
Because Auth0 is that dependency that is stopping us from moving to the Swift Package Manager
Have a look at Auth0toSPM.rb
- it's a script that performs the necessary modifications required to convert the Auth0.swift source to a Swift Package.
This is so (theoretically) when there is a new version of Auth0 we don't need to worry about manually making all the changes again
Steps include:
#if os(...)
instead of target-to-platform source file management. Use the same rules as in the original Podspec.import Foundation
lines where necessary as SPM is happily strict about thisWEB_AUTH_PLATFORM
preprocessor macro with #if os
using the same rules as the Podspec<
and >
in Objective-C imports anymore. Guess where this Objective-C module needs to be imported and add import
lines for it in the Swift source filesplistValues(bundle:)
function as including the Auth0.plist
in the bundle won't be supported until Swift 5.3 - however this breaks the real source so.. it's commented out in Auth0toSPM.rb
for now - you can make the change manually if you want to run the tests.You can see what was changed by the script by searching for // Added by Auth0toSPM
in the source files or looking at 9the diff](https://github.com/maxchuquimia/Auth0.swift/blob/master/changes.diff)
Note: generating the package and listing dependencies was done manually. Tests are commented out.
watchOS
won't work... maybe because we shouldn't be adding SimpleKeychain
to it? It does compile... It's 11:30pm now now, I can't remember my thoughts from this morning..m
test files in the Auth0.swift
tests that I haven't figured out the best way to copy across.. maybe all tests will be working when that's done. Feel free to make suggestions on how to achieve this. Also tests only run under iOS and you need to update the lowest supported platform from v9
(in the Podspec) to .v10
(in the Package.swift) in order to get tests running.Things are only impossible until they are not
Jean-Luc Picard
link |
Stars: 2 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics