refactor: Move darwin native sources into a canonical Sources/ tree#894
Conversation
|
Important Review skippedToo many files! This PR contains 222 files, which is 72 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (45)
📒 Files selected for processing (222)
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 |
f535c46 to
873ef63
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
873ef63 to
9b6cc63
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 30 minutes. |
Relocates auth0_flutter/darwin/Classes/*.swift into auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/, turning the old Classes/ location (and the ios/ and macos/ CocoaPods dirs) into symlinks generated by scripts/generate-symlinks.sh. This gives CocoaPods and a future SPM target a single canonical source location instead of duplicated/symlinked per-platform trees. Also renames SwiftAuth0FlutterPlugin -> Auth0FlutterPlugin and drops the Objective-C shim (Auth0FlutterPlugin.h/.m), since the class name can now match the pluginClass declared in pubspec.yaml directly without an ObjC bridge. Pure move: every relocated file is byte-identical to its previous location.
…rename Dropping the ObjC shim (Auth0FlutterPlugin.h/.m) in the previous commit removed the only source of a transitive Flutter import for Swift test files: main's Auth0FlutterPlugin.h did `#import <Flutter/Flutter.h>`, which the umbrella header re-exported to any `@testable import auth0_flutter` consumer. Without it, 18 test files that use FlutterError/UIModalPresentationStyle without importing Flutter/UIKit directly fail to compile. Adds the explicit imports, verified by a full xcodebuild test run on both iOS and macOS. Also fixes the macOS Xcode project, which still referenced the pre-rename SwiftAuth0FlutterPluginTests.swift filename after the test file was renamed to Auth0FlutterPluginTests.swift — this broke the macOS test target build (the iOS project was already fixed in the previous commit).
main added MfaAPI test files that use FlutterError without importing Flutter directly, relying on the transitive import that Auth0FlutterPlugin.h's this branch dropped the ObjC shim, so these 7 files (added by main after this branch was cut) need the same explicit Flutter/FlutterMacOS import already applied to the other test files in a previous commit. Verified with a full xcodebuild test run on both iOS (361 tests) and macOS.
9b6cc63 to
744fa89
Compare
📋 Changes
First of a cascading pair of PRs replacing #804 (closed — see comment for why it was split). Relocates
auth0_flutter/darwin/Classes/*.swiftintoauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/, turning the oldClasses/location — and theios//macos/CocoaPods directories — into symlinks generated byscripts/generate-symlinks.sh. This gives CocoaPods (and #893's SPM target) a single canonical source location instead of duplicated/symlinked per-platform trees.Also renames
SwiftAuth0FlutterPlugin→Auth0FlutterPluginand drops the Objective-C shim (Auth0FlutterPlugin.h/.m), since the class name can now match thepluginClassdeclared inpubspec.yamldirectly without an ObjC bridge.This is a pure move + rename for production code — no behavior change for CocoaPods consumers. One test-only fixture does change behavior (see below):
main).darwin/auth0_flutter.podspec'ssource_filesis updated to point at the new path;ios/andmacos/podspecs are unchanged (they still globClasses/**/*, which is now populated by regenerated symlinks).scripts/generate-symlinks.shis updated to generatedarwin/Classes/<rel> -> ../../auth0_flutter/Sources/auth0_flutter/<rel>andios|macos/Classes/<rel> -> ../../../darwin/Classes/<rel>, verifying every symlink resolves. Confirmed idempotent (re-running the script against its own output produces no diff), so the existingSymlinksCI job continues to pass.Tests/CredentialsManager/CredentialsManagerSpies.swift'sSpyCredentialsStorage.setEntrynow writes its argument intogetEntryReturnValue, making the spy round-trip like the real Keychain-backed storage. This is what letsCredentialsManagerGetMethodHandlerTests/CredentialsManagerHasValidMethodHandlerTests/etc. usecredentialsManager.store(credentials:)(which callssetEntrythen reads it back viagetEntry) instead of hand-buildingNSKeyedArchiverpayloads that duplicated the real storage's serialization format. Checked every call site — no test setsgetEntryReturnValueand later asserts it stays at that value after asetEntrycall, so nothing is clobbered by the change.No Dart files,
pubspec.yaml, or CI workflows are touched.📎 References
mainonce this merges.🎯 Testing
darwin/Classes/is byte-identical to itsmaincounterpart (2 intentional exceptions: the plugin class rename and dropping the ObjC shim).pod ipc spec auth0_flutter/darwin/auth0_flutter.podspecvalidates the podspec and resolvessource_filesto the 64 real Swift files under the newSources/path.scripts/generate-symlinks.shafter committing; zero diff, confirming CI'sSymlinkscheck will pass.plutil -linton the updated example iOSproject.pbxprojafter the test-file rename.