Skip to content

Declare FlutterFramework dependency in Package.swift - #160

Open
nicolas-chaix-didomi wants to merge 2 commits into
mainfrom
chore/spm-flutterframework-dependency
Open

Declare FlutterFramework dependency in Package.swift#160
nicolas-chaix-didomi wants to merge 2 commits into
mainfrom
chore/spm-flutterframework-dependency

Conversation

@nicolas-chaix-didomi

Copy link
Copy Markdown
Contributor

Change

Swift Package Manager support for the iOS plugin now depends on Flutter the way SPM expects, instead of bare linker flags.

  • Add the FlutterFramework package as a dependency at ../FlutterFramework. The Flutter tool generates that package next to the plugin package when building an app, so the relative path resolves at build time.
  • Both targets (DidomiSwift and didomi_sdk) now depend on the FlutterFramework product.
  • Drop the .linkedFramework("Flutter", .when(platforms: [.iOS])) linker settings from both targets, which the product dependency replaces.

This gives the targets the Flutter module for compilation, not just a link-time framework reference.

The Flutter tool warns on every iOS build that the plugin's Swift package
is missing a FlutterFramework dependency:

    Plugin didomi_sdk has a Package.swift for ios but is missing a
    dependency on FlutterFramework.

The manifest linked the Flutter framework via `.linkedFramework("Flutter")`,
which the tool no longer considers sufficient — it validates that the
manifest declares FlutterFramework as a package dependency and references
it from each target (see validatePluginSupportsSwiftPackageManager in
flutter_tools/lib/src/macos/darwin_dependency_management.dart).

Replace the linker settings with the form the tool expects. The
`../FlutterFramework` path resolves at app build time: the Flutter tool
generates that package alongside the copied plugin package, so it is not
expected to exist in this repository.

Verified: `swift package dump-package` parses the manifest, and
`pod lib lint didomi_sdk.podspec` still passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants