You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 00337d5
Browse filesBrowse the repository at this point in the historyBrowse files
[flutter_tools] Harden extension plugins and Dart hooks interop
Addresses design audit findings for custom platform plugins and Dart hooks interop:
- Fall back to a data-assets-only `CustomDataAssetTarget` when `BuildTarget.resolveNativeAssetsConfig` returns `null` (or `buildCodeAssets` is `null`) so transitive hook packages and `DataAsset` hooks succeed without failing `BuildHooks`.
- Validate `targetOs` and `targetArchitecture` against `^[a-z][a-z0-9_]*$` in `ExtensionNativeAssetsConfig`, `parseNativeOS`, and `parseNativeArchitecture`, reject `android`/`ios`/`macos` in `CustomCodeAssetTarget`, and populate `WindowsCCompilerConfig()` when `targetOs == OS.windows` without `envScript`.
- Add `ExtensionBuildTarget.buildTargetDefine` (`ExtensionBuildTarget`) so `AssembleCommand` resolves cross-compiler defines and `pluginPlatformKey` on built-in `TargetPlatform` names, reject ambiguous custom `targetPlatform` matches and disabled-feature `ExtensionBuildTarget` defines, resolve target `outputDir` via `resolveExtensionOutputDir`, and treat CLI `ExtensionCCompiler*` overrides atomically.
- Keep `CopyAssets` free of `InstallCodeAssets` and write `flutter_assets/NativeAssetsManifest.json` in `InstallCodeAssets` when extension platform defines are present.
- Reserve `FLUTTER_CUSTOM_PLATFORM` in `FlutterCommand`, drop the `kExtensionTargetOs` fallback in `resolveCustomPluginPlatformKey`, validate CLI `ExtensionPluginPlatformKey` values, preserve raw `pubspec.yaml` stanzas in `ExtensionPlugin.configuration` across built-in and custom keys, reject empty custom platform stanzas, and exclude `dev_dependencies` plugins in release builds.
Part of flutter#190755
Part of flutter#190754
0 commit comments