Skip to content

Replace the plugin build-type copy with initWith on the public DSL - #4

Open
reidbaker-agent wants to merge 1 commit into
agp-buildmode-depsfrom
agp-plugin-buildtypes
Open

Replace the plugin build-type copy with initWith on the public DSL#4
reidbaker-agent wants to merge 1 commit into
agp-buildmode-depsfrom
agp-plugin-buildtypes

Conversation

@reidbaker-agent

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

Copy link
Copy Markdown
Owner

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

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

  • PluginHandler no longer imports com.android.build.gradle.internal.dsl.BuildType.
    The build-type copy block that shared live legacy BuildType instances
    (addAll) for app-type plugin projects and hand-copied two properties
    for library plugin projects is replaced by a single initWith-based
    copy on the new-DSL containers: missing build types are created on
    the plugin project with initWith(appBuildType) (which carries
    matchingFallbacks), and isDebuggable is additionally copied when both
    sides are application build types. Library build types cannot receive
    app-specific properties through the public DSL - this is a documented
    behavior change of the migration (BuildConfig.DEBUG / JNI
    debuggability of plugins built for custom debuggable build types).
  • Production sources are now free of com.android.build.gradle.internal
    imports; InternalAgpApiImportTest locks that in (test sources may
    still use internals until the gradle-api dependency swap).
  • PluginHandlerTest: the two mock-only copy tests (which never invoked
    configurePlugins) are replaced with tests that run configurePlugins
    and assert the initWith copy for both a library plugin project and an
    app plugin project, including the custom-debuggable-build-type ->
    debug engine artifact mapping.
  • The planned pre-spike (afterEvaluate DSL mutation under newDsl=true)
    could not run in this sandbox; recorded in the migration doc with the
    finalizeDsl fallback. android_plugin_example_app_build and a custom
    build-type scratch build must confirm in CI.

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.

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

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

- PluginHandler no longer imports com.android.build.gradle.internal.dsl.BuildType.
  The build-type copy block that shared live legacy BuildType instances
  (addAll) for app-type plugin projects and hand-copied two properties
  for library plugin projects is replaced by a single initWith-based
  copy on the new-DSL containers: missing build types are created on
  the plugin project with initWith(appBuildType) (which carries
  matchingFallbacks), and isDebuggable is additionally copied when both
  sides are application build types. Library build types cannot receive
  app-specific properties through the public DSL - this is a documented
  behavior change of the migration (BuildConfig.DEBUG / JNI
  debuggability of plugins built for custom debuggable build types).
- Production sources are now free of com.android.build.gradle.internal
  imports; InternalAgpApiImportTest locks that in (test sources may
  still use internals until the gradle-api dependency swap).
- PluginHandlerTest: the two mock-only copy tests (which never invoked
  configurePlugins) are replaced with tests that run configurePlugins
  and assert the initWith copy for both a library plugin project and an
  app plugin project, including the custom-debuggable-build-type ->
  debug engine artifact mapping.
- The planned pre-spike (afterEvaluate DSL mutation under newDsl=true)
  could not run in this sandbox; recorded in the migration doc with the
  finalizeDsl fallback. android_plugin_example_app_build and a custom
  build-type scratch build must confirm in CI.

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.

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