Skip to content

Parse AndroidX property in gradle.properties - #188372

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
faheemabbas766:faheem-androidx-gradle-properties-parse
Jul 23, 2026
Merged

auto-submit[bot] merged 5 commits into
flutter:masterfrom
faheemabbas766:faheem-androidx-gradle-properties-parse

Conversation

@faheemabbas766

Copy link
Copy Markdown
Contributor

Parses android.useAndroidX from gradle.properties instead of using a raw substring match.

This avoids false positives from commented-out lines such as #android.useAndroidX=true, and false negatives for valid Gradle syntax such as android.useAndroidX = true.

This PR intentionally keeps the change scoped to property parsing and does not change the broader behavior for projects that omit the property entirely.

Part of #188306

Tests

./bin/flutter test packages/flutter_tools/test/general.shard/android/gradle_test.dart

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 ///), or this change does not require documentation updates.
  • I added new tests to check the change I am making.
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported, or this change is not a breaking change.
  • All existing and new tests are passing.

@faheemabbas766
faheemabbas766 requested a review from a team as a code owner June 23, 2026 06:54
@faheemabbas766
faheemabbas766 requested review from gmackall and removed request for a team June 23, 2026 06:54
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Jun 23, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors isAppUsingAndroidX in gradle.dart to parse gradle.properties line-by-line, ignoring comments and handling spaces around the property separator, and adds unit tests for these cases. The review feedback suggests moving the RegExp instantiation outside of the loop to avoid redundant compilation and improve performance.

Comment thread packages/flutter_tools/lib/src/android/gradle.dart Outdated
@jesswrd jesswrd added the CICD Run CI/CD label Jun 23, 2026
@gmackall
gmackall requested a review from jesswrd June 30, 2026 21:11
@gmackall

Copy link
Copy Markdown
Member

From android triage: looks like this is addressing the same problem as #188651

gmackall
gmackall previously approved these changes Jul 7, 2026
@gmackall

gmackall commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

changes lgtm but you'll need to fix analysis failures

info • Omit the type annotation on a local variable when the type is obvious. Try removing the type annotation • packages/flutter_tools/lib/src/android/gradle.dart:1100:9 • omit_obvious_local_variable_types

@faheemabbas766

Copy link
Copy Markdown
Contributor Author

changes lgtm but you'll need to fix analysis failures

info • Omit the type annotation on a local variable when the type is obvious. Try removing the type annotation • packages/flutter_tools/lib/src/android/gradle.dart:1100:9 • omit_obvious_local_variable_types

Addressed the analysis failure by removing the obvious local type annotation.

Validation:

  • ./bin/flutter analyze packages/flutter_tools/lib/src/android/gradle.dart packages/flutter_tools/test/general.shard/android/gradle_test.dart
  • ./bin/flutter test packages/flutter_tools/test/general.shard/android/gradle_test.dart

@faheemabbas766
faheemabbas766 requested a review from gmackall July 8, 2026 03:54
@reidbaker

Copy link
Copy Markdown
Contributor

@jesswrd is going to take responsibility for deduping this pr with another that does the same thing and shepherding one to land.

I think this is the prefered pr.

@jesswrd jesswrd added the CICD Run CI/CD label Jul 21, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jul 21, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jul 21, 2026
@jesswrd jesswrd mentioned this pull request Jul 21, 2026
8 of 10 tasks
@jesswrd jesswrd added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 23, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jul 23, 2026
Merged via the queue into flutter:master with commit 89af7cd Jul 23, 2026
27 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 23, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 24, 2026
flutter/flutter@2a2a79d...b65f4d9

2026-07-24 [email protected] Add dart_runtime_service_vm_aot.dart.snapshot to the snapshot list in the macOS code signing configuration (flutter/flutter#189981)
2026-07-24 [email protected] Roll Fuchsia Test Scripts from wLST_A-xfOeGT_5mj... to E8hJ1AfK8CtGtaES0... (flutter/flutter#189956)
2026-07-23 [email protected] Consolidate AndroidArch and DarwinArch into CpuArch (flutter/flutter#189315)
2026-07-23 [email protected] Roll Dart SDK from 9258584f98b8 to e3fc57eae9eb (7 revisions) (flutter/flutter#189949)
2026-07-23 [email protected] [flutter_tools] Do not always wait for the full timeout when running Spotlight to locate Android Studio on macOS (flutter/flutter#189952)
2026-07-23 [email protected] Roll Skia from 1d8bf9270d8c to 6e9c4687c001 (15 revisions) (flutter/flutter#189954)
2026-07-23 [email protected] [flutter_tools] Initialize Cache.flutterRoot at the start of the upgrade_test suite (flutter/flutter#189937)
2026-07-23 [email protected] Parse AndroidX property in gradle.properties (flutter/flutter#188372)
2026-07-23 [email protected] [Impeller]Use the IO context for OpenGL program setup (flutter/flutter#185723)
2026-07-23 [email protected] Allow building projects lacking Runner.xcworkspace (flutter/flutter#186239)
2026-07-23 [email protected] [flutter_tools] Invalidate WebEntrypointTarget when plugin set changes (flutter/flutter#189460)
2026-07-23 [email protected] Bump devtools_shared to 13.1.0 (flutter/flutter#189507)
2026-07-23 [email protected] forceNdkDownload should skip configuring cmake when ndk-build is used (flutter/flutter#187201)
2026-07-23 [email protected] Disable execution order shuffling for the flutter_tools upgrade_test suite (flutter/flutter#189920)
2026-07-23 [email protected] Move WindowManager outside of WidgetsApp (flutter/flutter#188866)
2026-07-23 [email protected] Roll Skia from 3424966b8a2b to 1d8bf9270d8c (3 revisions) (flutter/flutter#189901)
2026-07-23 [email protected] Roll Fuchsia Linux SDK from GswhlPRO-D1qSNclx... to 9org0yL3yZkp80x5S... (flutter/flutter#189898)
2026-07-23 [email protected] Remove outdated logs that were added to track #172636 (flutter/flutter#189282)
2026-07-23 [email protected] Roll Skia from 5e183e5aeac5 to 3424966b8a2b (33 revisions) (flutter/flutter#189890)
2026-07-23 [email protected] [examples] Use super parameters in missed spots (flutter/flutter#186194)
2026-07-23 [email protected] [flutter_tools] Bound Spotlight mdfind execution with timeout on macOS (flutter/flutter#189461)
2026-07-23 [email protected] Fix non primary buttons not being captured on windows (flutter/flutter#188394)
2026-07-22 [email protected] Listen to log reader before VM Service and make delay configurable (flutter/flutter#187202)
2026-07-22 [email protected] Roll Dart SDK from 1e65011ee004 to 9258584f98b8 (7 revisions) (flutter/flutter#189883)
2026-07-22 [email protected] Adds skill for generating engine diffs for new releases. (flutter/flutter#189869)
2026-07-22 [email protected] [ios,macos] Add Swift Sourcekit LSP support (flutter/flutter#189761)
2026-07-22 [email protected] [iOS] Mark DisplayLinkManager.shared and init() @mainactor (flutter/flutter#189815)
2026-07-22 [email protected] Fix `Rect::ExpandToMinTransformedSize` to return the input rectangle when no expansion is needed, and remove 1-pixel roundrect to rect simplification (flutter/flutter#189808)
2026-07-22 [email protected] Skip emulator.getEmulators test (flutter/flutter#189879)
2026-07-22 [email protected] Fix null terminator in input truncates clipboard (flutter/flutter#188652)

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

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD 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