Skip to content

Delete getLegacyAndroidExtension and migrate the NDK fallback to the public DSL - #5

Open
reidbaker-agent wants to merge 1 commit into
agp-plugin-buildtypesfrom
agp-ndk-fallback
Open

Delete getLegacyAndroidExtension and migrate the NDK fallback to the public DSL#5
reidbaker-agent wants to merge 1 commit into
agp-plugin-buildtypesfrom
agp-ndk-fallback

Conversation

@reidbaker-agent

@reidbaker-agent reidbaker-agent commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Phase 5 of 11 of the AGP public-API migration; stacked on #4.

Phase P4 of the AGP public-API migration (flutter#180137,
flutter#166550):

  • AgpCommonExtensionWrapper gains externalNativeBuild, and both the
    already-configuring-a-native-build check in forceNdkDownload and the
    synthetic-cmake fallback now read/write cmake.path,
    cmake.buildStagingDirectory and the per-build-type
    externalNativeBuild.cmake.arguments through the public DSL (property
    assignment with File values instead of the legacy Any-taking
    CmakeOptions methods; arguments via the public MutableList).
  • getLegacyAndroidExtension and the BaseExtension import are deleted
    from FlutterPluginUtils; nothing in production sources references
    BaseExtension anymore.
  • forceNdkDownload tests move their mocks from BaseExtension/
    internal CmakeOptions to the wrapper path (findByName("android") +
    public Cmake), assert cmake arguments by list content, and drop the
    defaultConfig-untouched assertions that only existed to guard the
    legacy extension. The two tests that asserted the old
    ApplicationExtension-vs-BaseExtension ndkVersion preference are
    deleted: getConfiguredNdkVersion has had a single source since P1.
    Also restores the findByType(ApplicationExtension) mocks (needed by
    isFlutterAppProject) that P1's test edit dropped in three tests.
  • FlutterPluginUtilsTest no longer imports internal.dsl.CmakeOptions or
    internal.dsl.DefaultConfig.

Verification note: FGP unit tests could not be executed in this sandbox
(network policy blocks dl.google.com); run 'gradle test' (both AGP
axes) in packages/flutter_tools/gradle in CI, plus an NDK-absent
scratch build exercising the synthetic-cmake fallback.

Revert-safe until P5 lands.

CI must run the FGP unit tests (the Kotlin suite in packages/flutter_tools/gradle could not run in the delivery sandbox: dl.google.com returns 403, so AGP artifacts do not resolve).

…public DSL

Phase P4 of the AGP public-API migration (flutter#180137,
flutter#166550):

- AgpCommonExtensionWrapper gains externalNativeBuild, and both the
  already-configuring-a-native-build check in forceNdkDownload and the
  synthetic-cmake fallback now read/write cmake.path,
  cmake.buildStagingDirectory and the per-build-type
  externalNativeBuild.cmake.arguments through the public DSL (property
  assignment with File values instead of the legacy Any-taking
  CmakeOptions methods; arguments via the public MutableList).
- getLegacyAndroidExtension and the BaseExtension import are deleted
  from FlutterPluginUtils; nothing in production sources references
  BaseExtension anymore.
- forceNdkDownload tests move their mocks from BaseExtension/
  internal CmakeOptions to the wrapper path (findByName("android") +
  public Cmake), assert cmake arguments by list content, and drop the
  defaultConfig-untouched assertions that only existed to guard the
  legacy extension. The two tests that asserted the old
  ApplicationExtension-vs-BaseExtension ndkVersion preference are
  deleted: getConfiguredNdkVersion has had a single source since P1.
  Also restores the findByType(ApplicationExtension) mocks (needed by
  isFlutterAppProject) that P1's test edit dropped in three tests.
- FlutterPluginUtilsTest no longer imports internal.dsl.CmakeOptions or
  internal.dsl.DefaultConfig.

Verification note: FGP unit tests could not be executed in this sandbox
(network policy blocks dl.google.com); run 'gradle test' (both AGP
axes) in packages/flutter_tools/gradle in CI, plus an NDK-absent
scratch build exercising the synthetic-cmake fallback.

Revert-safe until P5 lands.
@reidbaker
reidbaker force-pushed the agp-plugin-buildtypes branch from bece987 to ffbce64 Compare July 31, 2026 18:07
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