Skip to content

[AGP 9.1.0 Migration #3] Add buildModeFor overloads and wire Flutter dependencies through the new DSL - #191218

Merged
auto-submit[bot] merged 31 commits into
flutter:masterfrom
reidbaker-agent:agp-buildmode-deps
Aug 24, 2026
Merged

auto-submit[bot] merged 31 commits into
flutter:masterfrom
reidbaker-agent:agp-buildmode-deps

Conversation

@reidbaker-agent

@reidbaker-agent reidbaker-agent commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

This is PR 3 of 11 in the AGP 9.1.0 / public gradle-api/ newdsl migration stack.

  • It migrates many (but not all) usages of getLegacyAndroidExtension.
  • Introduces consistency in renaming of imports.
  • Adds a test to ensure we are not adding internal apis (thanks @mboetger from pr1)
  • builds the ability to run our gradle tests with multiple AGP versions (see packages/flutter_tools/gradle/build.gradle.kts)

Between PR 3 and PR 8, an Add-to-app host app embedding a Flutter module with a custom build type (for example "staging") gets release engine artifacts. That means hot reload, debugger attach, and DevTools do not operate in that build.
We can't move the work in PR 8 up but I would not want to cut a release between this pr and 8 landing. If we keep reviewing one pr a day then that is not a risk.

Apps impacted by this change can use matchingFallbacks to avoid this problem (see code below).

In pr 8 we change when we look for "isDebuggable" to much later in the gradle lifeycle when all the variants have been created which then lets us use a new api to understand if the variant is intended to be debuggable.

Kotlin

// host app build.gradle.kts
android {
    buildTypes {
        create("staging") {
            isDebuggable = true
            applicationIdSuffix = ".staging"
            matchingFallbacks += "debug" /// This line. 
        }
    }
}

Groovy

// host app build.gradle
android {
    buildTypes {
        staging {
            debuggable true
            applicationIdSuffix ".staging"
            matchingFallbacks = ['debug'] /// This line. 
        }
    }
}

Depends on #190957 (PR 2).


Standard review context for this pr stack

This is PR is part of an 11 pr stack to migrate the "newdsl" gradle-api specifically in agp 9.1.0.
The complete stack has passed presubmits, postsubmits, and customer tests: https://flutter-dashboard.appspot.com/#/build?repo=flutter&branch=experimental/agp-gradle-api

All of the code was LLM authored. A mix of manual prompting, automatic prompting, several models and adversarial review. The combined sessions are enough that I cannot include relevant prompts like I have been doing on other prs.

If you want to review the pr stack you can find it here. These prs will be abandoned/closed as prs land into flutter/flutter.

  1. Add AGP public-API migration docs (contributor doc + breaking-change page draft) reidbaker-agent/flutter#1 (branch: agp-api-doc)
  2. Remove AGP-internal imports from VersionFetcher and migrate compileSdk/ndk reads to the public DSL reidbaker-agent/flutter#2 (branch: agp-internal-utils)
  3. Add public buildModeFor overloads and wire Flutter dependencies through the new DSL reidbaker-agent/flutter#3 (branch: agp-buildmode-deps)
  4. Replace the plugin build-type copy with initWith on the public DSL reidbaker-agent/flutter#4 (branch: agp-plugin-buildtypes)
  5. Delete getLegacyAndroidExtension and migrate the NDK fallback to the public DSL reidbaker-agent/flutter#5 (branch: agp-ndk-fallback)
  6. Register the Flutter compile task lazily from the variant API for app projects reidbaker-agent/flutter#6 (branch: agp-assets-onvariants)
  7. Migrate the flutter-apk copy and per-ABI versionCode to the variant API reidbaker-agent/flutter#7 (branch: agp-apk-copy-versioncode)
  8. Unify add-to-app module wiring on the variant API and drop host-project cross-wiring reidbaker-agent/flutter#8 (branch: agp-add-to-app)
  9. Move aar_init_script off legacy AGP APIs reidbaker-agent/flutter#9 (branch: agp-aar-script)
  10. Flip the newDsl default: drop the opt-out from templates and migrate it away reidbaker-agent/flutter#10 (branch: agp-newdsl-flip)
  11. Compile the Flutter Gradle Plugin against the gradle-api artifact only reidbaker-agent/flutter#11 (branch: agp-gradle-api)

This work is urgent in the sense that we are worried that android will publish agp 10 with no opt out but not so urgent that we are willing to break flutter users because we didn't review or understand the code because we were in a rush.

Breaking changes are expected as part of this work. There are patterns the android team explicitly does not want apps to use and apis that have no equivalent.

As part of the effort to ensure this work does not slip into ai slop, prs from this stack will be reviewed by me (@reidbaker) before asking for review. Then we will have 2 android expert reviewers also review every pr.


Agent authored description.
This is PR 3 of 11 in the AGP 9.1.0 / public gradle-api migration stack (#180137, #166550).

Key Changes

  • DSL Build Mode Overloads: Adds buildModeFor overloads accepting ApplicationBuildType, DynamicFeatureBuildType, and LibraryBuildType DSL types alongside the (buildTypeName, isDebuggable) core overload.
  • Robust CompileSdkVersion Domain Model: Extracts CompileSdkVersion with constructor invariant validation (init { require(...) }) enforcing mutual exclusivity between apiLevel and previewCodename.
  • Namespaced Multi-AGP Build Property: Namespaces the AGP version property in packages/flutter_tools/gradle/build.gradle.kts as flutter.internal.agpVersion (defaulting to 8.11.1) to prevent user app properties from leaking into the included build during app compilation.
  • Standardized Type Aliasing: Applies non-temporal type aliasing (import com.android.build.api.dsl.BuildType as DslBuildType) across FlutterPlugin.kt and PluginHandler.kt.
  • Public DSL Extension Access: Updates addFlutterDependencies and PluginHandler to iterate AgpCommonExtensionWrapper.buildTypes.
  • Build & Bytecode Validation: Adds the :validateNoCommonExtensionInBytecode task in build.gradle.kts to prevent compiled main classes from referencing binary-incompatible CommonExtension, and adds BytecodeValidatorTest.kt verifying the binary pattern-matching and class scanning logic.
  • Comprehensive Unit Tests: Adds full 4-way dispatch test coverage in AgpCommonExtensionWrapperTest, dependency wiring tests in FlutterPluginTest, and decomposes PluginHandlerTest mock fixtures into focused helpers with positive assertions.

Add-to-App & DSL Scope Context

LibraryBuildType does not expose isDebuggable at DSL scope. In PR 3, custom build types on library projects (e.g. host app 'staging') fall back to "release" at DSL scope. In PR 8 ("Unify add-to-app module wiring on the variant API"), module wiring will be unified on Component.debuggable at variant scope.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

reidbaker and others added 16 commits July 31, 2026 13:52
…page draft)

Phase P0 of the Flutter Gradle Plugin migration to the AGP public API
surface (flutter#180137, flutter#166550): the contributor
migration record (replacement map, decision records, phase map,
revert-window table) and the draft of the user-facing breaking-change
page to be published to docs.flutter.dev before the newDsl flip reaches
beta.

Revert-safe: always.
…k/ndk reads to the public DSL

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

- VersionFetcher no longer calls the internal
  com.android.build.gradle.internal.utils.getKotlinAndroidPluginVersion.
  getKGPVersion now relies on the existing public fallback chain
  (kotlin_version property -> KotlinAndroidPluginWrapper.pluginVersion ->
  reflection) and documents that null is the expected result when KGP is
  absent (e.g. under AGP built-in Kotlin). DependencyVersionChecker
  already treats null as "KGP not required".
- AgpCommonExtensionWrapper gains compileSdkPreview.
- getCompileSdkFromProject now reads compileSdk/compileSdkPreview from
  the new DSL via the wrapper and returns a structured CompileSdkVersion
  instead of parsing the legacy "android-NN" string. The PluginHandler
  compileSdk mismatch warning uses CompileSdkVersion.isHigherThan, which
  defines the preview semantics the old string comparison got wrong
  (resolves the PluginHandler TODO): preview > numeric, distinct preview
  codenames incomparable (no warning), numeric compared numerically.
  Warning message text is unchanged.
- getConfiguredNdkVersion reads through the wrapper instead of the
  legacy BaseExtension fallback.
- Deletes the setAgpKotlinVersionToNull test helper (existed only to
  stub the internal AGP call) and updates unit tests accordingly; adds
  tests for both preview-vs-numeric directions and the codename reset
  case.

Verification note: the FGP unit test suite could not be executed in this
sandbox (the network policy blocks dl.google.com, so AGP artifacts do
not resolve); run 'gradle test' in packages/flutter_tools/gradle in CI.

Revert-safe until P2 lands.
…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.
# Conflicts:
#	packages/flutter_tools/gradle/build.gradle.kts
@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Aug 17, 2026
- Extract CompileSdkVersion domain model with invariant validation and unit tests
- Standardize non-temporal type aliases (ModelBuildType, DslBuildType, InternalDslBuildType)
- Add 4-way dispatch test coverage for AgpCommonExtensionWrapper across all extension types
- Add buildTypes.all execution and dependency registration tests in FlutterPluginTest
- Add missing SDK mismatch warning test in PluginHandlerTest
- Add dynamic-feature and library profile build-type tests in FlutterPluginUtilsTest
- Clean up KDoc and log debug message when KGP is undetected
@reidbaker
reidbaker requested review from gmackall and mboetger August 17, 2026 18:54
import org.jetbrains.kotlin.gradle.plugin.extraProperties
import java.io.File
import com.android.build.gradle.internal.dsl.BuildType as dslBuildType
import com.android.build.gradle.internal.dsl.BuildType as InternalDslBuildType

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rename is because the repo has several different import renames and part of what this pr does is make them consistent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably happened in #190957 but as I was reviewing this code I decided it should live in its own file.

if (kgpVersion != null) {
checkKGPVersion(kgpVersion, project)
} else {
project.logger.debug(

@reidbaker reidbaker Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is helpful for debugging but also I think it violates our style guidelines. Looking for second opinions.

Argument for is that because this uses the debug level you have to pass -d to get these logs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know mechanically what they would need to pass -d to? I.e. the flutter tool would accept that and print this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would have to run the assembleDebug task manually with the -d flag from the flutter tool the way to get these logs would be to set org.gradle.logging.level=debug in gradle.properties then run the flutter tool (probably with -v)

// AGP's method is internal, we try to use it anyway.
// KGP's version in org.jetbrains.kotlin.gradle.plugin.DefaultKotlinBasePlugin is not
// available when this method is called.
// When testing call `setAgpKotlinVersionToNull(project)`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed as this is part of the internal api surface we are not supposed to use. I knew that at the time and was just going to leave this in because it was helpful but agents when told to remove all apis that are internal do just that.

Comment thread packages/flutter_tools/gradle/src/main/kotlin/VersionFetcher.kt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not needed because we stopped using the internal kgp api for getting kotlin version.

Comment thread packages/flutter_tools/gradle/src/test/kotlin/AgpCommonExtensionWrapperTest.kt Outdated
Comment thread packages/flutter_tools/gradle/src/test/kotlin/plugins/PluginHandlerTest.kt Outdated
Comment thread packages/flutter_tools/gradle/build.gradle.kts Outdated
…ersion invariant, restored dependency wiring test, and decomposed PluginHandlerTest helpers
@reidbaker-agent reidbaker-agent changed the title [AGP 9.1.0 Migration #3] Add public buildModeFor overloads and wire Flutter dependencies through the new DSL [AGP 9.1.0 Migration #3] Add buildModeFor overloads and wire Flutter dependencies through the new DSL Aug 17, 2026
reidbaker
reidbaker previously approved these changes Aug 21, 2026

@reidbaker reidbaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will also open a pull request to add some of the agentic harness work that came out of this pr.

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Aug 21, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Aug 21, 2026
pull Bot pushed a commit to Budda0ne/flutter that referenced this pull request Aug 21, 2026
…1486)

This work came in response to pr
flutter#191218 and a conversation with
@gmackall about how I did not think the new dsl migration counted as
"agentic engineering" because I was not doing the work like we have as
part of project one shot in camera_android_camerax. Really the new dsl
work is a great opportunity to lay out some of the patterns we have
found.

@gmackall to double check the engineering principals and add any others
he thinks are important.
@camsim99 to help review agents.md. @camsim99 we have no skills or
really much documentation so the agents.md file has more primary logic
than I would normally like but I think in this case it is ok.

The purpose is to give agents working on the flutter gradle plugin
guidance for what we consider important and how we want to architect
work.

There are no evals in flutter/flutter so I have not written any. This is
acknowledged technical debt so we can get the benefit of this steering
on follow-up new dsl prs (4-11).

I consider this newDsl pr 3.1. 

- @reidbaker 

---
Agent authored description
## Description

This PR introduces `packages/flutter_tools/gradle/AGENTS.md` following
Jetski's directory-scoped `AGENTS.md` standard. This defines workspace
architectural rules, configuration cache compatibility, and development
practices for the Flutter Gradle Plugin (FGP).

### Key Rules Included:
1. **Zero Pollution of Customer-Facing Build Scripts**: Enforces
consumer build isolation in composite builds (`includeBuild`); forbids
contributor verification tasks or lifecycle hooks
(`check.dependsOn`/`test.dependsOn`) in `build.gradle.kts`, requiring
standard JUnit tests or CI shards instead.
2. **Type-Safe AGP & Gradle API Usage (No `@Suppress`)**: Prohibits raw
wildcard casts and `@Suppress("UNCHECKED_CAST")` when dealing with AGP
domain objects; mandates type-safe APIs and compatibility bridges.
3. **Lazy Configuration & Execution Avoidance**: Prohibits eager
`.get()` during configuration phase; requires Gradle Lazy Provider
chaining.
4. **Strict Configuration Cache Compatibility**: Forbids storing
`Project`, `SourceSet`, or `Configuration` references in task instances.
5. **Build Avoidance & Path Normalization**: Requires
`@PathSensitive(RELATIVE)` or `NAME_ONLY` to maximize local and remote
cache hits across machines.
6. **Worker API for Heavy Computation**: Decouples heavy computation,
parsing, and tooling execution to non-blocking worker threads.
7. **Namespace & Environment Hygiene**: Enforces `flutter.internal.`
property prefixing and full matrix verification across supported
AGP/Gradle versions.
8. **Scope & Legacy Code Policy (The Ratchet Principle)**: Enforces
compliance on all new and modified code while preventing unapproved
scope expansion on legacy code, while instructing agents to surface
adjacent improvement opportunities to the user.

## Related Issues
- Related to FGP architecture, AGP 8/9 compatibility, and Jetski agent
directory rules.

## Tests
- Documentation and rule file only (test-exempt).

## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

---------

Co-authored-by: Reid Baker <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 24, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 24, 2026
reidbaker pushed a commit to reidbaker-agent/flutter that referenced this pull request Aug 24, 2026
Merged via the queue into flutter:master with commit c3dc059 Aug 24, 2026
30 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 24, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 26, 2026
Roll Flutter from 9a8278982588 to 15d8908addf6 (37 revisions)

flutter/flutter@9a82789...15d8908

2026-08-25 [email protected] Roll Packages from df2ba94 to 740f093 (17 revisions) (flutter/flutter#191734)
2026-08-25 [email protected] [record_use] Remove const_finder (flutter/flutter#191702)
2026-08-25 [email protected] Warn when SwiftPM is disabled (flutter/flutter#188695)
2026-08-25 [email protected] Roll Skia from b1a31575c373 to 480540178356 (1 revision) (flutter/flutter#191723)
2026-08-25 [email protected] Roll pub packages (flutter/flutter#191726)
2026-08-25 [email protected] Roll Skia from bfa276ed9ac5 to b1a31575c373 (1 revision) (flutter/flutter#191717)
2026-08-25 [email protected] Roll Dart SDK from 0818e6dc28cc to 8996935d3d0a (2 revisions) (flutter/flutter#191706)
2026-08-25 [email protected] Roll Skia from 31799e707cd4 to bfa276ed9ac5 (1 revision) (flutter/flutter#191701)
2026-08-25 [email protected] iOS: Add null check for touch rate correction task runner (flutter/flutter#191641)
2026-08-25 [email protected] iOS: Add test for engineAllowHeadlessExecution (flutter/flutter#191635)
2026-08-25 [email protected] Roll Skia from cfae2af1bfeb to 31799e707cd4 (4 revisions) (flutter/flutter#191649)
2026-08-25 [email protected] Roll Dart SDK from 2b75c83ddd77 to 0818e6dc28cc (1 revision) (flutter/flutter#191643)
2026-08-25 [email protected] Roll Skia from 4a2fddefd3d8 to cfae2af1bfeb (1 revision) (flutter/flutter#191642)
2026-08-25 [email protected] Roll Skia from 256c15026b91 to 4a2fddefd3d8 (6 revisions) (flutter/flutter#191633)
2026-08-25 [email protected] Remove octant_offset_c uniform from ubersdf, reorder/document ubersdf uniforms (flutter/flutter#191597)
2026-08-25 [email protected] Roll Fuchsia Linux SDK from 8Xu4ujBJniC0nQGx3... to MstTWE1RDOT-RnrtH... (flutter/flutter#191621)
2026-08-25 [email protected] Roll Dart SDK from 78bbc37b6ff6 to 2b75c83ddd77 (3 revisions) (flutter/flutter#191614)
2026-08-24 [email protected] [flutter_tools] Fix $git typo in shared.bat to restore cache invalidation on Windows (flutter/flutter#191217)
2026-08-24 [email protected] Skip removed observers during app exit requests (flutter/flutter#190343)
2026-08-24 [email protected] [engine] Support UTF-8 paths in Windows filesystem and path APIs (flutter/flutter#191360)
2026-08-24 [email protected] Migrate ios driver tests batch 3 to simulators (flutter/flutter#191333)
2026-08-24 [email protected] Migrate texture example to material_ui (flutter/flutter#190673)
2026-08-24 [email protected] Remove outdated test todo about `dither` property of `Paint` (flutter/flutter#190936)
2026-08-24 [email protected] Add agent rule to prevent using material and cupertino in widget tests (flutter/flutter#191588)
2026-08-24 [email protected] [flutter_tools] Prevent crash when stdout is broken and print fails (flutter/flutter#191356)
2026-08-24 [email protected] Add FlViewRendererSubsurface (flutter/flutter#191389)
2026-08-24 [email protected] [Android] Inject `route` into manifest when specified on the command line in release mode (flutter/flutter#191328)
2026-08-24 [email protected] [AGP 9.1.0 Migration #3] Add buildModeFor overloads and wire Flutter dependencies through the new DSL (flutter/flutter#191218)
2026-08-24 [email protected] Roll Skia from 698c60bf58f1 to 256c15026b91 (1 revision) (flutter/flutter#191586)
2026-08-24 [email protected] On iOS 27+ devices, manually process lldb stops (flutter/flutter#191434)
2026-08-24 [email protected] [flutter_tools] Handle missing Xcode gracefully in getInfo and buildMacOS (flutter/flutter#191180)
2026-08-24 [email protected] [flutter_tools] Handle null version gracefully in CachedArtifact and MaterialFonts (flutter/flutter#191494)
2026-08-24 [email protected] [flutter_tools] Do not treat 'daemon' argument as daemon command in logger initialization (flutter/flutter#191442)
2026-08-24 [email protected] [flutter_tools] Resolve workspace root when running widget preview from member package (flutter/flutter#190952)
2026-08-24 [email protected] [native_assets] Roll native packages (flutter/flutter#191253)
2026-08-24 [email protected] [flutter_tools] Add --force flag to flutter channel (flutter/flutter#191579)
2026-08-24 [email protected] Roll Skia from 57968d087d18 to 698c60bf58f1 (1 revision) (flutter/flutter#191577)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

...
danielleon-cmd pushed a commit to victogomez-cs/packages-fork that referenced this pull request Aug 27, 2026
…r#12619)

Roll Flutter from 9a8278982588 to 15d8908addf6 (37 revisions)

flutter/flutter@9a82789...15d8908

2026-08-25 [email protected] Roll Packages from df2ba94 to 740f093 (17 revisions) (flutter/flutter#191734)
2026-08-25 [email protected] [record_use] Remove const_finder (flutter/flutter#191702)
2026-08-25 [email protected] Warn when SwiftPM is disabled (flutter/flutter#188695)
2026-08-25 [email protected] Roll Skia from b1a31575c373 to 480540178356 (1 revision) (flutter/flutter#191723)
2026-08-25 [email protected] Roll pub packages (flutter/flutter#191726)
2026-08-25 [email protected] Roll Skia from bfa276ed9ac5 to b1a31575c373 (1 revision) (flutter/flutter#191717)
2026-08-25 [email protected] Roll Dart SDK from 0818e6dc28cc to 8996935d3d0a (2 revisions) (flutter/flutter#191706)
2026-08-25 [email protected] Roll Skia from 31799e707cd4 to bfa276ed9ac5 (1 revision) (flutter/flutter#191701)
2026-08-25 [email protected] iOS: Add null check for touch rate correction task runner (flutter/flutter#191641)
2026-08-25 [email protected] iOS: Add test for engineAllowHeadlessExecution (flutter/flutter#191635)
2026-08-25 [email protected] Roll Skia from cfae2af1bfeb to 31799e707cd4 (4 revisions) (flutter/flutter#191649)
2026-08-25 [email protected] Roll Dart SDK from 2b75c83ddd77 to 0818e6dc28cc (1 revision) (flutter/flutter#191643)
2026-08-25 [email protected] Roll Skia from 4a2fddefd3d8 to cfae2af1bfeb (1 revision) (flutter/flutter#191642)
2026-08-25 [email protected] Roll Skia from 256c15026b91 to 4a2fddefd3d8 (6 revisions) (flutter/flutter#191633)
2026-08-25 [email protected] Remove octant_offset_c uniform from ubersdf, reorder/document ubersdf uniforms (flutter/flutter#191597)
2026-08-25 [email protected] Roll Fuchsia Linux SDK from 8Xu4ujBJniC0nQGx3... to MstTWE1RDOT-RnrtH... (flutter/flutter#191621)
2026-08-25 [email protected] Roll Dart SDK from 78bbc37b6ff6 to 2b75c83ddd77 (3 revisions) (flutter/flutter#191614)
2026-08-24 [email protected] [flutter_tools] Fix $git typo in shared.bat to restore cache invalidation on Windows (flutter/flutter#191217)
2026-08-24 [email protected] Skip removed observers during app exit requests (flutter/flutter#190343)
2026-08-24 [email protected] [engine] Support UTF-8 paths in Windows filesystem and path APIs (flutter/flutter#191360)
2026-08-24 [email protected] Migrate ios driver tests batch 3 to simulators (flutter/flutter#191333)
2026-08-24 [email protected] Migrate texture example to material_ui (flutter/flutter#190673)
2026-08-24 [email protected] Remove outdated test todo about `dither` property of `Paint` (flutter/flutter#190936)
2026-08-24 [email protected] Add agent rule to prevent using material and cupertino in widget tests (flutter/flutter#191588)
2026-08-24 [email protected] [flutter_tools] Prevent crash when stdout is broken and print fails (flutter/flutter#191356)
2026-08-24 [email protected] Add FlViewRendererSubsurface (flutter/flutter#191389)
2026-08-24 [email protected] [Android] Inject `route` into manifest when specified on the command line in release mode (flutter/flutter#191328)
2026-08-24 [email protected] [AGP 9.1.0 Migration #3] Add buildModeFor overloads and wire Flutter dependencies through the new DSL (flutter/flutter#191218)
2026-08-24 [email protected] Roll Skia from 698c60bf58f1 to 256c15026b91 (1 revision) (flutter/flutter#191586)
2026-08-24 [email protected] On iOS 27+ devices, manually process lldb stops (flutter/flutter#191434)
2026-08-24 [email protected] [flutter_tools] Handle missing Xcode gracefully in getInfo and buildMacOS (flutter/flutter#191180)
2026-08-24 [email protected] [flutter_tools] Handle null version gracefully in CachedArtifact and MaterialFonts (flutter/flutter#191494)
2026-08-24 [email protected] [flutter_tools] Do not treat 'daemon' argument as daemon command in logger initialization (flutter/flutter#191442)
2026-08-24 [email protected] [flutter_tools] Resolve workspace root when running widget preview from member package (flutter/flutter#190952)
2026-08-24 [email protected] [native_assets] Roll native packages (flutter/flutter#191253)
2026-08-24 [email protected] [flutter_tools] Add --force flag to flutter channel (flutter/flutter#191579)
2026-08-24 [email protected] Roll Skia from 57968d087d18 to 698c60bf58f1 (1 revision) (flutter/flutter#191577)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

...
@reidbaker
reidbaker deleted the agp-buildmode-deps branch August 28, 2026 13:55
NikhilKukreja26 pushed a commit to NikhilKukreja26/flutter that referenced this pull request Aug 28, 2026
…nitWith on public DSL (flutter#191606)

This is PR 4 of 11 in the AGP 9.1.0 / public `gradle-api` / newdsl
migration stack.

There are no breaking changes expected in this pr. Only internal logic
is impacted.

I will be honest I also found the tests hard to review. I had the agent
pull out shared mocking logic but I am not sure that actually made
review easier.

Depends on flutter#191218 (PR 3).
- @reidbaker

---
Standard review context for this pr stack

This is PR is part of an 11 pr stack to migrate the "newdsl"
`gradle-api` specifically in agp 9.1.0.

All of the code was LLM authored. A mix of manual prompting, automatic
prompting, several models and adversarial review. The combined sessions
are enough that I cannot include relevant prompts like I have been doing
on other prs.

If you want to review the pr stack you can find it here. These prs will
be abandoned/closed as prs land into flutter/flutter.
1. reidbaker-agent#1 (branch:
agp-api-doc)
2. reidbaker-agent#2 (branch:
agp-internal-utils)
3. reidbaker-agent#3 (branch:
agp-buildmode-deps)
4. reidbaker-agent#4 (branch:
agp-plugin-buildtypes)
5. reidbaker-agent#5 (branch:
agp-ndk-fallback)
6. reidbaker-agent#6 (branch:
agp-assets-onvariants)
7. reidbaker-agent#7 (branch:
agp-apk-copy-versioncode)
8. reidbaker-agent#8 (branch:
agp-add-to-app)
9. reidbaker-agent#9 (branch:
agp-aar-script)
10. reidbaker-agent#10 (branch:
agp-newdsl-flip)
11. reidbaker-agent#11 (branch:
agp-gradle-api)

This work is urgent in the sense that we are worried that android will
publish agp 10 with no opt out but not so urgent that we are willing to
break flutter users because we didn't review or understand the code
because we were in a rush.

Breaking changes are expected as part of this work. There are patterns
the android team explicitly does not want apps to use and apis that have
no equivalent.

As part of the effort to ensure this work does not slip into ai slop,
prs from this stack will be reviewed by me (@reidbaker) before asking
for review. Then we will have 2 android expert reviewers also review
every pr.

---
Agent authored description.
This is PR 4 of 11 in the AGP 9.1.0 / public `gradle-api` migration
stack (flutter#180137, flutter#166550).

### Key Changes
- **Public DSL `initWith` Copy**: Replaces the legacy
`getLegacyAndroidExtension` build-type copy in `PluginHandler` with
`initWith` on the public DSL (`AgpCommonExtensionWrapper.buildTypes`).
Missing build types on the plugin project are created with
`initWith(appBuildType)`, and `isDebuggable` is copied when both sides
are `ApplicationBuildType`.
- **Zero AGP Internals in Production Sources**: Removes the last
remaining `com.android.build.gradle.internal` imports from production
code (`src/main`).
- **Internal AGP Import Guard**: Adds `InternalAgpApiImportTest` to
continuously enforce that production sources do not introduce
`com.android.build.gradle.internal.*` imports.
- **Decomposed & Robust Unit Tests**: Replaces legacy mock-only tests in
`PluginHandlerTest` with tests that execute `configurePlugins` and
verify `initWith` copying for both library and application plugin
projects, mapping custom debuggable build types to debug engine
artifacts, and verifying that pre-existing plugin build types are
skipped.
- **Migration Documentation Update**: Adds details for the P3 pre-spike
and `finalizeDsl` fallback in
`Migrating-Flutter-Gradle-Plugin-to-AGP-public-API.md`.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12619)

Roll Flutter from 9a8278982588 to 15d8908addf6 (37 revisions)

flutter/flutter@9a82789...15d8908

2026-08-25 [email protected] Roll Packages from df2ba94 to 740f093 (17 revisions) (flutter/flutter#191734)
2026-08-25 [email protected] [record_use] Remove const_finder (flutter/flutter#191702)
2026-08-25 [email protected] Warn when SwiftPM is disabled (flutter/flutter#188695)
2026-08-25 [email protected] Roll Skia from b1a31575c373 to 480540178356 (1 revision) (flutter/flutter#191723)
2026-08-25 [email protected] Roll pub packages (flutter/flutter#191726)
2026-08-25 [email protected] Roll Skia from bfa276ed9ac5 to b1a31575c373 (1 revision) (flutter/flutter#191717)
2026-08-25 [email protected] Roll Dart SDK from 0818e6dc28cc to 8996935d3d0a (2 revisions) (flutter/flutter#191706)
2026-08-25 [email protected] Roll Skia from 31799e707cd4 to bfa276ed9ac5 (1 revision) (flutter/flutter#191701)
2026-08-25 [email protected] iOS: Add null check for touch rate correction task runner (flutter/flutter#191641)
2026-08-25 [email protected] iOS: Add test for engineAllowHeadlessExecution (flutter/flutter#191635)
2026-08-25 [email protected] Roll Skia from cfae2af1bfeb to 31799e707cd4 (4 revisions) (flutter/flutter#191649)
2026-08-25 [email protected] Roll Dart SDK from 2b75c83ddd77 to 0818e6dc28cc (1 revision) (flutter/flutter#191643)
2026-08-25 [email protected] Roll Skia from 4a2fddefd3d8 to cfae2af1bfeb (1 revision) (flutter/flutter#191642)
2026-08-25 [email protected] Roll Skia from 256c15026b91 to 4a2fddefd3d8 (6 revisions) (flutter/flutter#191633)
2026-08-25 [email protected] Remove octant_offset_c uniform from ubersdf, reorder/document ubersdf uniforms (flutter/flutter#191597)
2026-08-25 [email protected] Roll Fuchsia Linux SDK from 8Xu4ujBJniC0nQGx3... to MstTWE1RDOT-RnrtH... (flutter/flutter#191621)
2026-08-25 [email protected] Roll Dart SDK from 78bbc37b6ff6 to 2b75c83ddd77 (3 revisions) (flutter/flutter#191614)
2026-08-24 [email protected] [flutter_tools] Fix $git typo in shared.bat to restore cache invalidation on Windows (flutter/flutter#191217)
2026-08-24 [email protected] Skip removed observers during app exit requests (flutter/flutter#190343)
2026-08-24 [email protected] [engine] Support UTF-8 paths in Windows filesystem and path APIs (flutter/flutter#191360)
2026-08-24 [email protected] Migrate ios driver tests batch 3 to simulators (flutter/flutter#191333)
2026-08-24 [email protected] Migrate texture example to material_ui (flutter/flutter#190673)
2026-08-24 [email protected] Remove outdated test todo about `dither` property of `Paint` (flutter/flutter#190936)
2026-08-24 [email protected] Add agent rule to prevent using material and cupertino in widget tests (flutter/flutter#191588)
2026-08-24 [email protected] [flutter_tools] Prevent crash when stdout is broken and print fails (flutter/flutter#191356)
2026-08-24 [email protected] Add FlViewRendererSubsurface (flutter/flutter#191389)
2026-08-24 [email protected] [Android] Inject `route` into manifest when specified on the command line in release mode (flutter/flutter#191328)
2026-08-24 [email protected] [AGP 9.1.0 Migration flutter#3] Add buildModeFor overloads and wire Flutter dependencies through the new DSL (flutter/flutter#191218)
2026-08-24 [email protected] Roll Skia from 698c60bf58f1 to 256c15026b91 (1 revision) (flutter/flutter#191586)
2026-08-24 [email protected] On iOS 27+ devices, manually process lldb stops (flutter/flutter#191434)
2026-08-24 [email protected] [flutter_tools] Handle missing Xcode gracefully in getInfo and buildMacOS (flutter/flutter#191180)
2026-08-24 [email protected] [flutter_tools] Handle null version gracefully in CachedArtifact and MaterialFonts (flutter/flutter#191494)
2026-08-24 [email protected] [flutter_tools] Do not treat 'daemon' argument as daemon command in logger initialization (flutter/flutter#191442)
2026-08-24 [email protected] [flutter_tools] Resolve workspace root when running widget preview from member package (flutter/flutter#190952)
2026-08-24 [email protected] [native_assets] Roll native packages (flutter/flutter#191253)
2026-08-24 [email protected] [flutter_tools] Add --force flag to flutter channel (flutter/flutter#191579)
2026-08-24 [email protected] Roll Skia from 57968d087d18 to 698c60bf58f1 (1 revision) (flutter/flutter#191577)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

...
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12619)

Roll Flutter from 9a8278982588 to 15d8908addf6 (37 revisions)

flutter/flutter@9a82789...15d8908

2026-08-25 [email protected] Roll Packages from df2ba94 to 740f093 (17 revisions) (flutter/flutter#191734)
2026-08-25 [email protected] [record_use] Remove const_finder (flutter/flutter#191702)
2026-08-25 [email protected] Warn when SwiftPM is disabled (flutter/flutter#188695)
2026-08-25 [email protected] Roll Skia from b1a31575c373 to 480540178356 (1 revision) (flutter/flutter#191723)
2026-08-25 [email protected] Roll pub packages (flutter/flutter#191726)
2026-08-25 [email protected] Roll Skia from bfa276ed9ac5 to b1a31575c373 (1 revision) (flutter/flutter#191717)
2026-08-25 [email protected] Roll Dart SDK from 0818e6dc28cc to 8996935d3d0a (2 revisions) (flutter/flutter#191706)
2026-08-25 [email protected] Roll Skia from 31799e707cd4 to bfa276ed9ac5 (1 revision) (flutter/flutter#191701)
2026-08-25 [email protected] iOS: Add null check for touch rate correction task runner (flutter/flutter#191641)
2026-08-25 [email protected] iOS: Add test for engineAllowHeadlessExecution (flutter/flutter#191635)
2026-08-25 [email protected] Roll Skia from cfae2af1bfeb to 31799e707cd4 (4 revisions) (flutter/flutter#191649)
2026-08-25 [email protected] Roll Dart SDK from 2b75c83ddd77 to 0818e6dc28cc (1 revision) (flutter/flutter#191643)
2026-08-25 [email protected] Roll Skia from 4a2fddefd3d8 to cfae2af1bfeb (1 revision) (flutter/flutter#191642)
2026-08-25 [email protected] Roll Skia from 256c15026b91 to 4a2fddefd3d8 (6 revisions) (flutter/flutter#191633)
2026-08-25 [email protected] Remove octant_offset_c uniform from ubersdf, reorder/document ubersdf uniforms (flutter/flutter#191597)
2026-08-25 [email protected] Roll Fuchsia Linux SDK from 8Xu4ujBJniC0nQGx3... to MstTWE1RDOT-RnrtH... (flutter/flutter#191621)
2026-08-25 [email protected] Roll Dart SDK from 78bbc37b6ff6 to 2b75c83ddd77 (3 revisions) (flutter/flutter#191614)
2026-08-24 [email protected] [flutter_tools] Fix $git typo in shared.bat to restore cache invalidation on Windows (flutter/flutter#191217)
2026-08-24 [email protected] Skip removed observers during app exit requests (flutter/flutter#190343)
2026-08-24 [email protected] [engine] Support UTF-8 paths in Windows filesystem and path APIs (flutter/flutter#191360)
2026-08-24 [email protected] Migrate ios driver tests batch 3 to simulators (flutter/flutter#191333)
2026-08-24 [email protected] Migrate texture example to material_ui (flutter/flutter#190673)
2026-08-24 [email protected] Remove outdated test todo about `dither` property of `Paint` (flutter/flutter#190936)
2026-08-24 [email protected] Add agent rule to prevent using material and cupertino in widget tests (flutter/flutter#191588)
2026-08-24 [email protected] [flutter_tools] Prevent crash when stdout is broken and print fails (flutter/flutter#191356)
2026-08-24 [email protected] Add FlViewRendererSubsurface (flutter/flutter#191389)
2026-08-24 [email protected] [Android] Inject `route` into manifest when specified on the command line in release mode (flutter/flutter#191328)
2026-08-24 [email protected] [AGP 9.1.0 Migration flutter#3] Add buildModeFor overloads and wire Flutter dependencies through the new DSL (flutter/flutter#191218)
2026-08-24 [email protected] Roll Skia from 698c60bf58f1 to 256c15026b91 (1 revision) (flutter/flutter#191586)
2026-08-24 [email protected] On iOS 27+ devices, manually process lldb stops (flutter/flutter#191434)
2026-08-24 [email protected] [flutter_tools] Handle missing Xcode gracefully in getInfo and buildMacOS (flutter/flutter#191180)
2026-08-24 [email protected] [flutter_tools] Handle null version gracefully in CachedArtifact and MaterialFonts (flutter/flutter#191494)
2026-08-24 [email protected] [flutter_tools] Do not treat 'daemon' argument as daemon command in logger initialization (flutter/flutter#191442)
2026-08-24 [email protected] [flutter_tools] Resolve workspace root when running widget preview from member package (flutter/flutter#190952)
2026-08-24 [email protected] [native_assets] Roll native packages (flutter/flutter#191253)
2026-08-24 [email protected] [flutter_tools] Add --force flag to flutter channel (flutter/flutter#191579)
2026-08-24 [email protected] Roll Skia from 57968d087d18 to 698c60bf58f1 (1 revision) (flutter/flutter#191577)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants