The FlutterPluginRegistrant should generate GeneratedPluginRegistrant files, which import all Flutter plugins. These files are put in a directory per build mode to allow us the option to have different plugins per build mode (such as if we wanted to exclude dev dependencies from release builds).
├── FlutterPluginRegistrant
│ ├── Debug
│ │ ├── FlutterPluginRegistrant
│ │ │ ├── GeneratedPluginRegistrant.m
│ │ │ ├── include
│ │ │ │ ├── GeneratedPluginRegistrant.h
│ │ ├── Package.swift
│ ├── Sources -> symlink to ./Debug
│ ├── Package.swift -> symlink to ./Debug/Package.swift
It will also create a Package.swift for the package.
let package = Package(
name: "FlutterPluginRegistrant",
products: [
.library(name: "FlutterPluginRegistrant", type: .static, targets: ["FlutterPluginRegistrant"])
],
dependencies: [
.package(name: "FlutterFramework", path: "Sources/Packages/FlutterFramework"),
.package(name: "plugin_with_swiftpm_support", path: "Sources/Packages/plugin_with_swiftpm_support"),
.package(name: "FlutterConfigurationPlugin", path: "../FlutterConfigurationPlugin")
],
targets: [
.target(
name: "FlutterPluginRegistrant",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework"),
.target(name: "App"),
.product(name: "plugin-with-swiftpm-support", package: "plugin_with_swiftpm_support"),
.target(name: "cocoapod_only_plugin"),
.target(name: "native_asset_plugin")
]
),
.binaryTarget(
name: "App",
path: "Sources/Frameworks/App.xcframework"
),
.binaryTarget(
name: "cocoapod_only_plugin",
path: "Sources/Frameworks/CocoaPods/cocoapod_only_plugin.xcframework"
),
.binaryTarget(
name: "native_asset_plugin",
path: "Sources/Frameworks/NativeAssets/native_asset_plugin.xcframework"
)
]
)
The
FlutterPluginRegistrantshould generateGeneratedPluginRegistrantfiles, which import all Flutter plugins. These files are put in a directory per build mode to allow us the option to have different plugins per build mode (such as if we wanted to exclude dev dependencies from release builds).It will also create a Package.swift for the package.