Skip to content

Add public buildModeFor overloads and wire Flutter dependencies through the new DSL - #3

Open
reidbaker-agent wants to merge 1 commit into
agp-internal-utilsfrom
agp-buildmode-deps
Open

Add public buildModeFor overloads and wire Flutter dependencies through the new DSL#3
reidbaker-agent wants to merge 1 commit into
agp-internal-utilsfrom
agp-buildmode-deps

Conversation

@reidbaker-agent

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

Copy link
Copy Markdown
Owner

Phase 3 of 11 of the AGP public-API migration; stacked on #2.

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

  • buildModeFor gains a (buildTypeName, isDebuggable) core overload and a
    new-DSL BuildType overload. Application and dynamic-feature build
    types use their public isDebuggable flag; library build types have no
    public debuggable signal at DSL scope, so the conventional "debug"
    name is used for them. The legacy com.android.builder.model.BuildType
    overload remains for the variant-scope call sites that migrate in
    later phases.
  • addFlutterDependencies (engine/embedding deps) now takes a new-DSL
    BuildType, and FlutterPlugin registers it via the wrapper's buildTypes
    container instead of the legacy BaseExtension.
  • PluginHandler's three dependency-wiring loops (per-build-type Api
    wiring, embedding deps, plugin-to-plugin deps) iterate the wrapper
    container. The build-type copy block still uses the legacy container
    and internal.dsl.BuildType; that is phase P3.
  • build.gradle.kts accepts -PagpVersion= so CI can compile and test the
    plugin against the AGP 9 line in addition to the default (the public
    DSL is not binary-compatible between AGP 8 and 9 everywhere), and a
    new validateNoCommonExtensionInBytecode task fails the build if any
    compiled main class references CommonExtension (the known-broken
    type that AgpCommonExtensionWrapper exists to avoid).
  • android_run_flutter_gradle_plugin_tests_test.dart gains a second test
    running the suite with -PagpVersion=<templateAndroidGradlePluginVersion>.
  • PluginHandlerTest no longer depends on exhausted-iterator mock
    behavior; the wrapper container returns a fresh iterator per call.

Verification note: FGP unit tests could not be executed in this sandbox
(network policy blocks dl.google.com); run 'gradle test' and
'gradle -PagpVersion=9.1.0 test' in packages/flutter_tools/gradle in CI.

Revert-safe until P3 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).

…gh the new DSL

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

- buildModeFor gains a (buildTypeName, isDebuggable) core overload and a
  new-DSL BuildType overload. Application and dynamic-feature build
  types use their public isDebuggable flag; library build types have no
  public debuggable signal at DSL scope, so the conventional "debug"
  name is used for them. The legacy com.android.builder.model.BuildType
  overload remains for the variant-scope call sites that migrate in
  later phases.
- addFlutterDependencies (engine/embedding deps) now takes a new-DSL
  BuildType, and FlutterPlugin registers it via the wrapper's buildTypes
  container instead of the legacy BaseExtension.
- PluginHandler's three dependency-wiring loops (per-build-type Api
  wiring, embedding deps, plugin-to-plugin deps) iterate the wrapper
  container. The build-type copy block still uses the legacy container
  and internal.dsl.BuildType; that is phase P3.
- build.gradle.kts accepts -PagpVersion= so CI can compile and test the
  plugin against the AGP 9 line in addition to the default (the public
  DSL is not binary-compatible between AGP 8 and 9 everywhere), and a
  new validateNoCommonExtensionInBytecode task fails the build if any
  compiled main class references CommonExtension (the known-broken
  type that AgpCommonExtensionWrapper exists to avoid).
- android_run_flutter_gradle_plugin_tests_test.dart gains a second test
  running the suite with -PagpVersion=<templateAndroidGradlePluginVersion>.
- PluginHandlerTest no longer depends on exhausted-iterator mock
  behavior; the wrapper container returns a fresh iterator per call.

Verification note: FGP unit tests could not be executed in this sandbox
(network policy blocks dl.google.com); run 'gradle test' and
'gradle -PagpVersion=9.1.0 test' in packages/flutter_tools/gradle in CI.

Revert-safe until P3 lands.
@reidbaker
reidbaker force-pushed the agp-buildmode-deps branch from 3996bce to 5a528c3 Compare July 31, 2026 18:07
@reidbaker
reidbaker force-pushed the agp-internal-utils branch from 47b3ac5 to 4aefffe 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