Skip to content

Flip the newDsl default: drop the opt-out from templates and migrate it away - #10

Open
reidbaker-agent wants to merge 1 commit into
agp-aar-scriptfrom
agp-newdsl-flip
Open

Flip the newDsl default: drop the opt-out from templates and migrate it away#10
reidbaker-agent wants to merge 1 commit into
agp-aar-scriptfrom
agp-newdsl-flip

Conversation

@reidbaker-agent

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

Copy link
Copy Markdown
Owner

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

Phase P9 of the AGP public-API migration (flutter#180137,
flutter#166550) - the breaking-change PR. The Flutter Gradle
Plugin is public-API-only since P7/P8, so projects no longer need
android.newDsl=false:

  • The app and module gradle.properties templates no longer ship the
    newDsl opt-out (android.builtInKotlin=false stays; it belongs to the
    separate built-in Kotlin migration).
  • DisableNewDslMigration is replaced by RemoveNewDslOptOutMigration,
    which removes exactly the line pairs Flutter wrote: one of the two
    known marker comments ('added by the Flutter template' / 'added
    automatically by Flutter migrator') immediately followed by
    android.newDsl=false. The removal is anchored on the android.newDsl
    property line, so the adjacent builtInKotlin marker/flag lines are
    never touched; hand-added opt-outs and developer-edited values are
    respected; the file the old migrator created with only the flag is
    emptied. A visible status message names the change and links the
    breaking-change page.
  • New legacyVariantApiUsageErrorHandler matches the Gradle failures
    users hit when their build scripts use the removed legacy variant API
    (unknown property/method applicationVariants, libraryVariants,
    testVariants, variantFilter) and prints problem, cause, fix
    (androidComponents.onVariants), the breaking-change page URL, and the
    android.newDsl=false escape hatch with its AGP 10 expiry.
    useNewAgpDslErrorHandler is retired: its signature was the FGP's own
    legacy DSL access failing under newDsl, which can no longer happen.
  • kNewDslBreakingChangeDocsUrl pins the docs.flutter.dev page location;
    the in-repo website-page draft records that the page must be
    published at that exact path before this reaches beta.
  • The migration doc records the stable-channel release-management step
    (guard or accept the add-migrator flip-flop during the overlap
    window).

Verified here: android_project_migration_test.dart (42/42) and
gradle_errors_test.dart (56/56) pass with the repo Dart SDK; dart
analyze clean on the changed files. CI preconditions before this ships:
full newDsl=true matrix green (R6), website page live, top-25 pub.dev
plugin scratch-app sweep under -Pandroid.newDsl=true, and
GradleHandledError eventLabel hit-rate monitoring during the beta soak
as the stable go/no-go signal.

Cleanly revertible in isolation.

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).

…it away

Phase P9 of the AGP public-API migration (flutter#180137,
flutter#166550) - the breaking-change PR. The Flutter Gradle
Plugin is public-API-only since P7/P8, so projects no longer need
android.newDsl=false:

- The app and module gradle.properties templates no longer ship the
  newDsl opt-out (android.builtInKotlin=false stays; it belongs to the
  separate built-in Kotlin migration).
- DisableNewDslMigration is replaced by RemoveNewDslOptOutMigration,
  which removes exactly the line pairs Flutter wrote: one of the two
  known marker comments ('added by the Flutter template' / 'added
  automatically by Flutter migrator') immediately followed by
  android.newDsl=false. The removal is anchored on the android.newDsl
  property line, so the adjacent builtInKotlin marker/flag lines are
  never touched; hand-added opt-outs and developer-edited values are
  respected; the file the old migrator created with only the flag is
  emptied. A visible status message names the change and links the
  breaking-change page.
- New legacyVariantApiUsageErrorHandler matches the Gradle failures
  users hit when their build scripts use the removed legacy variant API
  (unknown property/method applicationVariants, libraryVariants,
  testVariants, variantFilter) and prints problem, cause, fix
  (androidComponents.onVariants), the breaking-change page URL, and the
  android.newDsl=false escape hatch with its AGP 10 expiry.
  useNewAgpDslErrorHandler is retired: its signature was the FGP's own
  legacy DSL access failing under newDsl, which can no longer happen.
- kNewDslBreakingChangeDocsUrl pins the docs.flutter.dev page location;
  the in-repo website-page draft records that the page must be
  published at that exact path before this reaches beta.
- The migration doc records the stable-channel release-management step
  (guard or accept the add-migrator flip-flop during the overlap
  window).

Verified here: android_project_migration_test.dart (42/42) and
gradle_errors_test.dart (56/56) pass with the repo Dart SDK; dart
analyze clean on the changed files. CI preconditions before this ships:
full newDsl=true matrix green (R6), website page live, top-25 pub.dev
plugin scratch-app sweep under -Pandroid.newDsl=true, and
GradleHandledError eventLabel hit-rate monitoring during the beta soak
as the stable go/no-go signal.

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