Skip to content

Compile the Flutter Gradle Plugin against the gradle-api artifact only - #11

Open
reidbaker-agent wants to merge 2 commits into
agp-newdsl-flipfrom
agp-gradle-api
Open

Compile the Flutter Gradle Plugin against the gradle-api artifact only#11
reidbaker-agent wants to merge 2 commits into
agp-newdsl-flipfrom
agp-gradle-api

Conversation

@reidbaker-agent

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

Copy link
Copy Markdown
Owner

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

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

  • build.gradle.kts swaps both AGP dependencies from the full
    com.android.tools.build:gradle artifact to
    com.android.tools.build:gradle-api. Compilation is now the proof that
    the plugin uses zero AGP internals (AGP 10 removes access to them
    entirely), on top of the InternalAgpApiImportTest source check and
    the validateNoCommonExtensionInBytecode bytecode check, which stay as
    fast-feedback guards.
  • FlutterPluginTest is rewritten on public-API mocks only: the
    AbstractAppExtension multi-interface mock, BaseExtension,
    CommonExtension, internal.dsl.DefaultConfig, and the legacy
    sourceSets/AndroidSourceDirectorySet mocks are gone. No test source
    references a full-artifact-only or internal type anymore.
  • The --android-skip-build-dependency-validation help text now warns
    that skipping validation cannot make unsupported AGP versions work:
    builds below the supported minimum fail in Gradle regardless.
  • The android tooling README gains the AGP-bump checklist step to run
    the FGP test suite against the new version's public API artifact
    (-PagpVersion axis) and links the migration doc.

Verification (CI): full matrix per the migration doc (gradle unit tests
on both AGP axes - now both against gradle-api; scratch-app matrix;
add-to-app source/AAR flows; config-cache baseline). Dart analyzer
clean on the changed tool file.

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 P10, the final phase of the AGP public-API migration
(flutter#180137, flutter#166550):

- build.gradle.kts swaps both AGP dependencies from the full
  com.android.tools.build:gradle artifact to
  com.android.tools.build:gradle-api. Compilation is now the proof that
  the plugin uses zero AGP internals (AGP 10 removes access to them
  entirely), on top of the InternalAgpApiImportTest source check and
  the validateNoCommonExtensionInBytecode bytecode check, which stay as
  fast-feedback guards.
- FlutterPluginTest is rewritten on public-API mocks only: the
  AbstractAppExtension multi-interface mock, BaseExtension,
  CommonExtension, internal.dsl.DefaultConfig, and the legacy
  sourceSets/AndroidSourceDirectorySet mocks are gone. No test source
  references a full-artifact-only or internal type anymore.
- The --android-skip-build-dependency-validation help text now warns
  that skipping validation cannot make unsupported AGP versions work:
  builds below the supported minimum fail in Gradle regardless.
- The android tooling README gains the AGP-bump checklist step to run
  the FGP test suite against the new version's public API artifact
  (-PagpVersion axis) and links the migration doc.

Verification (CI): full matrix per the migration doc (gradle unit tests
on both AGP axes - now both against gradle-api; scratch-app matrix;
add-to-app source/AAR flows; config-cache baseline). Dart analyzer
clean on the changed tool file.

Cleanly revertible in isolation.
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