feat: Swift Package Manager dependency support for Flutter iOS/macOS SDK#804
feat: Swift Package Manager dependency support for Flutter iOS/macOS SDK#804NandanPrabhu wants to merge 14 commits into
Conversation
29e7c3d to
4128680
Compare
fd7f369 to
d3b8c46
Compare
d3b8c46 to
035c772
Compare
8e2281b to
45d2569
Compare
|
Important Review skippedToo many files! This PR contains 171 files, which is 21 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (171)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
flutter config --enable-swift-package-manager must run after Flutter is installed and before flutter pub get so that SPM-based dependencies (Auth0.swift resolved via Package.swift) are properly set up when building and running native iOS/macOS unit tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The FlutterGeneratedPluginSwiftPackage (created during flutter pub get) picks up the iOS deployment target from the Xcode toolchain. When Xcode was configured after pub get, the generated Package.swift defaulted to iOS 13.0 instead of reading the project's IPHONEOS_DEPLOYMENT_TARGET of 14.0, causing: error: The package product 'auth0-flutter' requires minimum platform version 14.0 for the iOS platform, but this target supports 13.0 Fix: move "Setup Xcode" and "Save Xcode version" steps before "Enable Swift Package Manager" and "flutter pub get".
…id test LoginWebAuthRequestHandlerTest referenced CustomTabsOptions and BrowserPicker (both in com.auth0.android.provider) without importing them, causing compileDebugUnitTestKotlin to fail with unresolved references. Importing WebAuthProvider from the same package does not bring in its siblings. Verified with ./gradlew koverXmlReportDebug.
| @@ -1 +0,0 @@ | |||
| ../../../darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift No newline at end of file | |||
There was a problem hiding this comment.
do we need to delete this file?
📋 Changes
Adds Swift Package Manager (SPM) support to the iOS/macOS (
darwin) native plugin, addressing #793. CocoaPods support is retained as a fallback, so this is non-breaking for existing consumers.Packaging
auth0_flutter/darwin/auth0_flutter/Package.swiftdeclaring theauth0_flutterSPM target (iOS 14 / macOS 11), depending on Auth0.swift, JWTDecode.swift and SimpleKeychain via.upToNextMajor(from:)so the plugin stays co-installable with consumer apps that pull the same Auth0 packages.auth0_flutter.podspecsource_filesto point at the new sharedSources/auth0_flutterlayout; version pins kept in sync withPackage.swift.Sources/auth0_flutter, relying onsharedDarwinSource: true(declared inpubspec.yaml) so iOS and macOS build from a single source tree.Removed symlink machinery
scripts/generate-symlinks.shand thecheck-symlinksworkflow —sharedDarwinSourcereplaces the per-platform symlink approach.auth0_flutter/iosandauth0_flutter/macossymlinked source trees.Plugin entry point
Auth0FlutterPlugin.h/.m) and renames the Swift plugin classSwiftAuth0FlutterPlugin→Auth0FlutterPluginto match thepluginClassalready declared inpubspec.yaml. No public Dart API change.Example app
Podfile, workspace) to SPM (Package.resolved, project-based build).AppDelegateadopts@main+applicationSupportsSecureRestorableState.CI
setup-darwin: drops the Ruby/Bundler andpod installsteps; enables SPM (flutter config --enable-swift-package-manager) and forces the Flutter-generated package's deployment target to match the plugin's (14.0 / 11.0).unit-tests-darwin: runs againstRunner.xcodeprojinstead of the (now removed) workspace..xcresultto Cobertura XML viaxcresultparser(Ruby-free) before the Codecov upload, replacing the removedslatherstep. The orphanedexample/ios/Gemfile/Gemfile.lock(slather only) are deleted.Tests
Auth0FlutterPluginTests.credentialsManager.store(credentials:)instead of hand-builtNSKeyedArchiverfixtures.📎 References
🎯 Testing
xcodebuildagainstRunner.xcodeproj(Xcode 26.2); Android and Windows unit suites unchanged.auth0_flutter/example, runflutter config --enable-swift-package-managerthenflutter build ios/flutter build macosand exercise login/logout, credentials manager, and DPoP flows.