Commit Graph

236 Commits

Author SHA1 Message Date
Ian Hickson
487bd69078
Support disabling animations in the CLI (#132239) 2023-08-23 03:35:22 +00:00
Christopher Fujino
a6118612ac
Fix flutter attach local engine (#131825)
Fixes: https://github.com/flutter/flutter/issues/124970
Part of https://github.com/flutter/flutter/issues/47161

Before this change, there were two places we overrode the `Artifacts` in a Zone:

1. if/when we parse local-engine CLI options: 1cf3907407/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart (L281)
2. an additional override for fuchsia platform dill (no longer used, deleted in this PR): 1cf3907407/packages/flutter_tools/lib/src/commands/attach.dart (L274)

Note 1 above creates a new instance of `Artifacts.getLocalEngine()`. In this flow, there exist two instances of `Artifacts`:

1. The default fallback instance of `CachedArtifacts` (which gets all artifacts from flutter/bin/cache), instantiated in context_runner.dart: 1cf3907407/packages/flutter_tools/lib/src/context_runner.dart (L137)
2. An instance of `CachedLocalEngineArtifacts` created in the command runner once the CLI options have been parsed: 1cf3907407/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart (L281)

The regression happened when we direct injected the Artifacts 1 from above BEFORE we parsed the local-engine flag, and then used this in the second zone override, and then when creating the `FlutterDevice` there are multiple calls to `globals.artifacts` returned it when it should have returned Artifacts 2: 1cf3907407/packages/flutter_tools/lib/src/resident_runner.dart (L80)

Device.artifactOverrides was originally introduced in https://github.com/flutter/flutter/pull/32071, but is no longer used, so I deleted it.

I also removed direct injection of `Artifacts` to the attach sub-command, because that class now no longer references artifacts.

I believe the ideal true fix for this would be to:

1. Migrate all leaf calls to `globals.artifacts` to use direct injection (in this case, the offending invocations were in [`FlutterDevice.create()`](1cf3907407/packages/flutter_tools/lib/src/resident_runner.dart (L80-L218)), but I'm not sure that something else would not have broken later)
2. Ensure we are always direct injecting the desired instance of `Artifacts`--that is, if the user desires local engine artifacts, that we are passing an instance of `CachedLocalEngineArtifacts`.
  a. Alternatively, and probably simpler, teach `CachedArtifacts` to know about the local engine. This would mean parsing the global CLI options BEFORE we ever construct any instance of `Artifacts`.
  
As an overall recommendation for implementing https://github.com/flutter/flutter/issues/47161, in the overall tree of tool function calls, we should probably migrate the leaves first (that is, migrate the sub-commands last). We should also audit and reconsider any usage of `runZoned()` or `context.run()` for the purpose overriding zoneValues.
2023-08-10 17:51:05 +00:00
Christopher Fujino
6f3b07811b
[flutter_tools] delete flutter format command (#129360)
On the current stable branch (3.10.x), `flutter format` no longer works, and gives an error. This change just deletes the code.

Fixes https://github.com/flutter/flutter/issues/115809
2023-06-22 21:28:55 +00: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
3736274a6d
Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280)
Revert "[flutter_tools] Remove sound null safety flag (#123031)"
2023-03-22 22:53:49 +00:00
Christopher Fujino
f4c3facfdd
Revert "Revert "[flutter_tools] Remove sound null safety flag (#120936)" (#122909)" (#123031)
[flutter_tools] Remove sound null safety flag #2
2023-03-20 22:32:07 +00:00
Christopher Fujino
f6bc147c91
Revert "[flutter_tools] Remove sound null safety flag (#120936)" (#122909)
This reverts commit 7c3088cf22.
2023-03-17 11:31:48 -07:00
Christopher Fujino
7c3088cf22
[flutter_tools] Remove sound null safety flag (#120936)
[flutter_tools] Remove sound null safety flag
2023-03-17 17:48:35 +00:00
Christopher Fujino
7e151b4641
[flutter_tools] throw tool exit on invocation of flutter format (#121646)
[flutter_tools] throw tool exit on invocation of flutter format
2023-03-16 21:40:26 +00:00
Jackson Gardner
db1c3e208d
Platform binaries reland (#115502)
You can now specify a --local-web-sdk flag to point to a wasm_release folder. This will make it so that only artifacts that pertain to the web sdk are overridden to point to the wasm_release folder. Other artifacts (such as impellerc) will pull from the cache, or from the --local-engine path if that is specified.

This also uses precompiled platform kernel files for both ddc and dart2js
2022-12-02 14:13:40 -08:00
Jesús S Guerrero
530324d232
Build command dependency injection (#114383)
* update flutter build command

* update tests

* fix analyze suggestions
2022-11-08 23:38:10 +00:00
Alex Wallen
7020f59ace
[tool] Support --flavor option for flutter install. (#114048)
* Alphabetize setup calls

* Add --flavor as an option for install

* Add verbose logging in install command

* Test that flavors build succeeds with proper flavor and fails with bogus one.

* Remove unused import

* The import was used...

* SQUASH

* Add flavor install test

* Rename test

* Add flavors install integration tests

* correct error message

* remove unused imports

* Delete copy test

* update test target

* Refactor mechanism to read buildInfo

* Remove unused import

* Set affected test targets to bringup: true

Co-authored-by: a-wallen <stephenwallen@google.com>
2022-11-08 22:53:23 +00:00
Jenn Magder
28ab431096
Make Logger required when injected in flutter_tool (#114111) 2022-10-27 22:40:08 +00:00
Christopher Fujino
d40f6d1e68
[flutter_tools] allow flutter drive to take screenshots when sent a terminating signal (#114118) 2022-10-27 18:51:15 +00:00
Jesús S Guerrero
eea60f86f1
Dependency injection Attach command (#113227) 2022-10-18 17:30:01 +00:00
Gary Qian
21861423f2
[flutter_tools] analyze --suggestions --machine command (#112217) 2022-10-03 17:40:58 +00:00
Elias Yishak
0c829caad8
error handling when path to dir provided instead of file (#109796) 2022-09-14 21:13:13 +00:00
Christopher Fujino
08d5d51a98
[flutter_tools] Instantiate shutdown hooks before localfilesystem (#110693) 2022-09-02 17:38:56 +00:00
Jesús S Guerrero
e271e8428b
add GeneralInfo project validator to analyze --suggestions (#109874) 2022-08-19 21:18:49 +00:00
Tae Hyung Kim
646666f8e7
[gen_l10n] Add option to format generated localizations files (#109171)
* init

* fix

* fix 2

* fix 3

* tests

* fix tests

* clarify help text

* fix all tests

* fix formatting?

* add second test

* unused import

* remove print

* trailing spaces

* artifacts is never null

* fix
2022-08-19 14:03:42 -07:00
jensjoha
981bdf5476
[flutter_tools] Make flutter test -v print timing of different phases (#108864) 2022-08-18 16:26:56 +00:00
Jesús S Guerrero
cdf5b1d40d
Pub dependencies project validator (#106895) 2022-07-15 23:12:05 +00:00
Jesús S Guerrero
ddd493b927
[flutter_tools] migrate project-validate to analyze --suggestions (#106149) 2022-06-24 18:43:07 +00:00
Jonah Williams
92034482f9
[flutter_tool] partial null safety migration of tool source code (#105798) 2022-06-15 20:02:07 +00:00
Jason Simmons
ba4d63a47b
Exit the tool if a DevTools subprocess fails when running on a bot (#97613) 2022-02-02 14:55:18 -08:00
Christopher Fujino
e8ec8a0dfb
[flutter_tools] Catch lack of flutter tools source missing (#93168) 2021-11-12 14:43:52 -08:00
Jenn Magder
9e88fe328e
Remove globals_null_migrated.dart, move into globals.dart (#92861) 2021-11-01 17:18:03 -07:00
Danny Tuppeny
de966d8a49
Add a "flutter debug_adapter" command that runs a DAP server (#91802) 2021-10-27 06:48:06 -07:00
Kenzie (Schmoll) Davisson
5a85c0d81c
Launch DevTools from the 'dart devtools' command instead of pub (#90894) 2021-09-29 15:32:24 -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
Jonah Williams
63a4013160
Revert "[flutter_tools] let the logger know about machine mode (#86116)" (#86363)
This reverts commit 53d8cba3ec.
2021-07-13 10:39:35 -07:00
Ian Hickson
d3c17acf9d
Run "pub global activate devtools" before overall_experience_test (#85812) 2021-07-12 14:36:05 -07:00
Jonah Williams
53d8cba3ec
[flutter_tools] let the logger know about machine mode (#86116) 2021-07-12 10:41:03 -07:00
Hannes Winkler
a1e9f2057f
[custom-devices] general improvements, add custom-devices subcommand, better error handling (#82043) 2021-07-07 09:16:04 -07:00
Ahmed Ashour
529a599ce6
Fix some indentation (#84967) 2021-07-01 13:41:04 -07:00
Jonah Williams
10840352ce
[flutter_tools] switch flutter sdk to dart format (#84273) 2021-06-10 07:54:03 -07:00
Jenn Magder
19eab105a5
Migrate build_system, exceptions, and source to null safety (#83147) 2021-05-24 10:29:04 -07:00
Jonah Williams
b30d97a64c
[flutter_tools] split host artifacts out of Artifacts (#80876) 2021-04-22 19:29:02 -07:00
Jenn Magder
3463946448
Take screenshot when drive fails (#78822) 2021-03-22 19:06:28 -07:00
Jonah Williams
cf903d7392
[flutter_tools] remove globals from process, filesystem (#78357) 2021-03-22 10:35:40 -07:00
Jonah Williams
666c950989
[flutter_tools] replace most MockBuildSystem instances with TestBuildSystem (#76821) 2021-02-26 08:46:00 -08:00
Ian Hickson
ce318b7b53
All arguments must be documented. (#75888) 2021-02-14 12:56:05 -08:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
J-P Nurmi
e1ff62a78c
[flutter_tools] propagate build errors from the backend (#72196) 2021-01-14 13:39:05 -08:00
Jenn Magder
912c3ab171
Revert "Revert "[flutter_tools] Serve DevTools at app start (#73366)" (#73896)" (#73903)
This reverts commit 388dcd2478.
2021-01-13 15:36:43 -08:00
Jenn Magder
388dcd2478
Revert "[flutter_tools] Serve DevTools at app start (#73366)" (#73896)
This reverts commit 1cb0a24a46.
2021-01-13 13:57:09 -08:00
Kenzie Schmoll
1cb0a24a46
[flutter_tools] Serve DevTools at app start (#73366)
* [flutter_tools] Serve DevTools at app start
2021-01-12 21:39:27 -08:00
Shi-Hao Hong
a912030982
[gen_l10n] Use l10n.yaml file instead of command line arguments if it exists (#72950)
* Reorganize files

* Use l10n.yaml instead of command line args
2021-01-05 11:50:32 +08:00
Kenzie Schmoll
cd452286ab
Launch DevTools from pub instead of devtools_server (#71737)
* Launch DevTools from pub instead of devtools_server
2020-12-14 10:12:42 -08:00
Jonah Williams
ffbca11f1b
[flutter_tools] delete BuildRunnerWebCompilationProxy and WebCompilationProxy (#70914) 2020-12-01 09:54:43 -08:00