[tool] Make more commands work without Flutter#11797
Conversation
Updates some cases where 'flutter' was used unconditionally, now that we need to support a repository without Flutter installed. Removes some outdated comments and plumbing for forcing `flutter pub` over `dart pub`, as the reason we used to do it no longer applies now that `dart pub` also fetches examples by default.
There was a problem hiding this comment.
Code Review
This pull request updates the tooling to use either flutter or dart for pub commands (including analyze, publish, and publish-check) depending on whether the package requires Flutter. It also removes the alwaysUseFlutter parameter from runPubGet and updates the corresponding tests. The reviewer suggested using _dartBinaryPath instead of the hardcoded 'dart' executable in AnalyzeCommand to respect the custom SDK path specified via the --analysis-sdk option.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the tooling to support non-Flutter-based repositories. It ensures that pub commands use either flutter or dart depending on whether the package requires Flutter for analysis and publishing. Additionally, it introduces the --skip-if-not-supporting-dart-version option to allow skipping packages based on Dart version constraints rather than Flutter versions. Relevant tests have been updated and added to verify these behaviors. I have no feedback to provide as there are no review comments.
chunhtai
left a comment
There was a problem hiding this comment.
mostly looks good, just some suggestion that we should probably refactor some common logic out since they are used in multiple places
…r#187306) flutter/packages@10cbdc5...e930ced 2026-05-28 [email protected] [vector_graphics_compiler]: Fix Stack Overflow and CPU/Memory DoS on SVGs with circular references or exponential expansions (flutter/packages#11740) 2026-05-28 [email protected] [tool] Make more commands work without Flutter (flutter/packages#11797) 2026-05-28 [email protected] Roll Flutter from c8f2f16 to e70534d (18 revisions) (flutter/packages#11799) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
#11797 changed the repo tooling to use `dart` instead of `flutter` for more commands when the target package isn't a Flutter package, include `pub downgrade` and `pub get` in `analyze`. However, since `pub get` will resolve any example apps, if any of *them* use Flutter, `dart pub get` will fail unless `dart` is coming from the Flutter SDK. Normally this is fine since that's the expected setup, but for the head-head tests in dart-lang that run the repo analysis using the head version of Dart via the `--analysis-sdk` flag, using that version of Dart for pub commands breaks things. This checks the example apps for Flutter dependencies to ensure that `dart pub` won't be used in cases where that can cause failures to resolve in the examples. This should be safe for core-packages, since core-packages should never use Flutter, even in examples.
flutter puboverdart pub, as the reason we used to do it no longer applies now thatdart pubalso fetches examples by default.--skip-if-not-supporting-dart-versionto support N-1 and N-2 testing in core-packages.