Commit Graph

288 Commits

Author SHA1 Message Date
Matan Lurey
66367dd888 Remove message about pub cache that is not actionable (#143357)
... and neither the pub nor tools team think it's important.

Fixes https://github.com/flutter/flutter/issues/140628.
2024-02-13 11:15:15 -08:00
Lau Ching Jun
ac7879e2aa Avoid depending on files from build_system/targets other than from top level entrypoints in flutter_tools. (#142760)
Add a new `BuildTargets` class that provides commonly used build targets. And avoid importing files from `build_system/targets` except from the top level entrypoints or from top level commands.

Also move `scene_importer.dart` and `shader_compiler.dart` into `build_system/tools` because they are not `Target` classes, but wrapper for certain tools.

With this change, we can ignore all files in `build_system/targets` internally and make PR #142709 easier to land internally. See cl/603434066 for the corresponding internal change.

Related to:
https://github.com/flutter/flutter/pull/142709
https://github.com/flutter/flutter/issues/142041

Also note that I have opted to add a new variable in `globals.dart` for `BuildTargets` in this PR, but I know that we are trying to get rid of globals. Several alternatives that I was considering:

1. Add a new field in `BuildSystem` that returns a `BuildTargets` instance. Since `BuildSystem` is already in `globals`, we can access build targets using `globals.buildSystem.buildTargets` without adding a new global variable.
2. Properly inject the `BuildTargetsImpl` instance from the top level `executable.dart` and top level commands.

Let me know if you want me to do one of the above instead. Thanks!
2024-02-02 18:23:08 +00:00
Christopher Fujino
d550ba54eb [flutter_tools] toolexit when using plugins with preview device (#136936)
Part of https://github.com/flutter/flutter/issues/130277

Without this, if a user runs an app that has plugins that call method channels with the `preview` device, the app will build successfully, however, they will get a runtime error when their dart code tries to call the method channel that does not exist in the native build (which was pre-built and thus does not include the plugin code).

This change adds a validation when injecting plugins that will tool exit if the device-id is `preview` and their project contains plugins with method channels.
2023-11-07 20:37:19 +00:00
Dery Rahman Ahaddienata
6b5766d41e Fix dart pub cache clean command on pub.dart (#128171)
Command instruction for clearing dart pub cache is somewhat wrong. Instead of `clear`, `clean` is the correct one. Ref: https://dart.dev/tools/pub/cmd/pub-cache

Fixes https://github.com/flutter/flutter/issues/128663

(Edited by @andrewkolos. Changed "related to" issue to "fixes" to link this PR to the issue).
2023-06-15 20:38:04 +00:00
Sigurd Meldgaard
7b54a30e31 Notify about existing caches when preloading (#122592) 2023-03-30 16:20:33 +02:00
Janice Collins
81e9060968 Suppress analytics flag pass through to analysis server (#123235)
Suppress analytics flag pass through to analysis server
2023-03-24 19:59:15 +00:00
Christopher Fujino
7d767270b2 [flutter_tools] replace --no-analytics with --suppress-analytics (#123133)
[flutter_tools] replace --no-analytics with --suppress-analytics
2023-03-21 19:18:57 +00:00
Sigurd Meldgaard
1fd84f88e9 Always use user-level pub cache (#121802)
Use the pub cache resolved by pub itself.
To add packages to the flutter.zip download they are packaged as tar.gz and added to the pub-cache on first run by using  `pub cache preload`.
2023-03-13 08:38:17 +01:00
Sigurd Meldgaard
7a28078509 Use dart pub instead of dart __deprecated pub (#121605) 2023-03-06 11:23:12 +01:00
Lioness100
26b6c1bedd Fix typos (#121171)
* Fix typos

* lowercase animated & opacity

* Undo typo fix

---------

Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-02-23 19:43:21 +00:00
Michael Goderbauer
38630b6bd1 Remove unnecessary null checks in flutter_tool (#118857)
* dart fix --apply

* manual fixes

* fix after merge conflicts

* review
2023-01-23 21:43:08 +00:00
Andrew Kolos
ee1c59d462 reduce pub output from flutter create (#118285)
* reduce pub output from flutter create

* fix fake Pub implementations

* fix tests

* Update pub.dart

* replace enum with simpler boolean

* fix tests

* Revert "fix tests"

This reverts commit 8a3182d3b95d4f2bf337343cdb76e88c2f428ca8.

* Revert "replace enum with simpler boolean"

This reverts commit 445dbc443db4eb5ce284f76749f60e81208b8783.

* go back to using an enum
2023-01-12 21:42:02 +00:00
Sigurd Meldgaard
40bc6b55e4 Move debug error message from failed pub to logger.printTrace (#118379)
* Move debug error message from failed pub to logger.printTrace

* Update test
2023-01-12 19:24:20 +00:00
Sigurd Meldgaard
b7881e5b64 Align flutter pub get/upgrade/add/remove/downgrade (#117896)
* Align `flutter pub get/upgrade/add/remove/downgrade`

* Add final . to command description

* Remove trailing whitespace

* Don't print message that command is being run

* Update expectations

* Use relative path

* Remove duplicated line

* Improve function dartdoc
2023-01-10 23:29:09 +00:00
Nehal Patel
de2a42497f Fix flutter update-packages regression by fixing parameters in "pub get" runner (#116687)
* Make pub get runner respect printProgress and retry parameters

* Fix typo

* Add regression test

* Improve test

* Fix implementation and test

* Test to fix flutter_drone tests

* Revert test

* Attempt #2 to fix flutter_drone tests

* Revert attempt

* Hack: Force printProgress to debug Windows tests

* Use ProcessUtils.run to avoid dangling stdout and stderr

* Update documentation

* Clean up retry argument
2023-01-06 00:08:05 +00:00
Nehal Patel
3b15d6a501 Removes retries from "dart pub get" and un-buffers its stdout/stderr output (#115801)
* Removes retries from "pub get" and proxies its stdout output

* Fix issue where ErrorHandlingProcessManager does not forward "mode" parameter to backing ProcessManager's "start" method

* Make "pub get" use ProcessStartMode.inheritStdio instead of forwarding bytes to stdout and stderr

* Fix tests

* Remove unused env var

* Add back 'Running "flutter pub get"...' status log

* Fix indent

* Add Pub.test() constructor which lets tests mock stdio
2022-12-01 19:30:17 +00:00
Christopher Fujino
559d524ec1 improve debugging when dart pub get call fails (#112968) 2022-10-05 21:53:06 +00:00
Sigurd Meldgaard
d80e994a62 Reland: Show output from pub get in flutter pub get (#110851) 2022-09-08 15:13:23 +02:00
Zachary Anderson
0e195e9d46 Revert "Show output from pub get in flutter pub get (#106300)" (#110478)
This reverts commit 3802eb627e.
2022-08-29 08:02:50 -07:00
Sigurd Meldgaard
3802eb627e Show output from pub get in flutter pub get (#106300) 2022-08-29 07:37:19 +00:00
Jesús S Guerrero
6048e07f47 [flutter_tools] join flutter specific with home cache (#105343) 2022-07-29 19:58:06 +00:00
Christopher Fujino
6abd3691c3 [flutter_tools] add more debugging when pub get fails (#108062) 2022-07-21 19:22:07 +00:00
Jenn Magder
c6ced845e3 Remove custom unawaited, prefer dart:async version (#103212) 2022-05-07 08:49:04 -07:00
Christopher Fujino
0d83e80104 [flutter_tools] Null safe update packages (#99357) 2022-03-17 13:35:17 -07:00
Swift Kim
2a010d9673 [flutter_tools] Make variants of Pub have consistent method signatures (#98119) 2022-02-11 00:45:20 -08:00
Jenn Magder
410d9921bc Migrate emulators, packages, upgrade, and downgrade to null safety (#95712) 2022-01-05 16:50:19 -08:00
Christopher Fujino
b0810bc939 Fix analysis throwing string (#91435) 2021-10-29 17:02:05 -07:00
Christopher Fujino
f753168cb6 [flutter_tools] add working directory to ProcessException when pub get fails (#91436) 2021-10-07 18:08:04 -07:00
Greg Spencer
01af8e5987 Make flutter update-packages run in parallel (#91006)
This modifies the flutter update-packages and flutter update-packages --force-upgrade commands so that the many invocations of "dart pub get" in each repo project run in parallel instead of in series.
2021-09-30 10:26:31 -07:00
Jason Simmons
cd19bc6007 Do not retry if pub get is run in offline mode (#90394) 2021-09-27 08:18:06 -07:00
Sigurd Meldgaard
bce366203a Stop calling top level pub (#89032)
* Use `dart __deprecated_pub` instead of `pub` to invoke pub from tools

The top level `pub` commmand has been deprecated and will print
a message. It is however implemented via the __deprecated_pub command
that prints no message.
2021-08-30 10:40:10 -07:00
Zachary Anderson
b4e0472b04 Revert "Use dart pub instead of pub to invoke pub from tools (#88509)" (#88792)
This reverts commit 7c24ff2c5b.
2021-08-24 09:00:22 -07:00
Sigurd Meldgaard
7c24ff2c5b Use dart pub instead of pub to invoke pub from tools (#88509)
Top level `pub` is being deprecated.
2021-08-24 15:51:08 +02:00
Jonah Williams
fa0782b696 reassign jonahwilliams todos (#88707) 2021-08-23 12:27:07 -07:00
Remi Rousselet
1995da2c0c Disable the automatic "pub get" if the project is using a third-party tool for linking dependencies. (#86177) 2021-07-19 08:06:03 -07:00
Greg Spencer
88f3811055 Turn on avoid_dynamic_calls lint, except packages/flutter tests, make appropriate changes. (#84476)
This adds avoid_dynamic_calls to the list of lints, and fixes all instances where it was violated.

Importantly, this lint is NOT turned on for flutter/packages/test, because those changes are happening in another PR: #84478
2021-06-14 14:16:57 -07:00
Jenn Magder
2bf0627dea Migrate localizations and generate_synthetic_packages to null safety (#83310) 2021-05-25 11:09:02 -07:00
Jonah Williams
302e992ca7 [flutter_tools] throw a tool exit if pub cannot be run (#83293) 2021-05-24 14:34:02 -07:00
Michael Goderbauer
f7bcfa8e95 Be more helpful when l10n generation fails (#83134) 2021-05-21 17:19:02 -07:00
Abhishek Ghaskata
b554f893bd Enable unnecessary_null_checks lint (#82084) 2021-05-14 10:44:03 -07:00
Jenn Magder
8d5f08fe02 Migrate pub in flutter_tools to null safety (#80548) 2021-04-16 17:23:00 -07:00
Jenn Magder
ec14cef060 Migrate more tool unit tests to null safety (#80002) 2021-04-08 15:18:52 -07:00
Jonah Williams
304448af8c [flutter_tools] consume package:process exceptions (#79657) 2021-04-02 12:08:29 -07:00
Jenn Magder
bc4bda021f Migrate analysis to null safety (#79525) 2021-04-01 18:29:32 -07:00
Jonah Williams
35bd77bb08 [flutter_tools] separate concept of null safe language version from current language version (#79052) 2021-03-25 17:14:34 -07:00
Konstantin Scheglov
e31064978a Add '--protocol-traffic-log' option to 'analyze' command. (#78674) 2021-03-25 15:09:05 -07:00
Jenn Magder
5398c34cfe Migrate flutter_project_metadata to null safety (#78944) 2021-03-24 15:21:23 -07:00
Jenn Magder
8a0cc1bef7 Make launguage_version in flutter_tool null safe (#78843) 2021-03-23 10:11:07 -07:00
Perqin
131f59f17e [flutter_tools] Avoid duplicated calls to l10n generation (#76066) 2021-02-25 12:11:03 -08:00
Jonah Williams
021311ed8a Revert "[flutter_tools] move process manager into tool (#75350)" (#75639)
This reverts commit 8b6baae44c.
2021-02-08 09:21:46 -08:00