Commit Graph

72 Commits

Author SHA1 Message Date
Srujan Gaddam
9393aae393
Align web terminal messages with the VM (#163268)
- Adds better instructions for hot reload (if using the right flags),
hot restart, quitting, clearing, and more. These were already being
printed when using the VM, so this aligns with that.
- Adds an extra parameter for `CommandHelp` to `ResidentRunner` so
`ResidentWebRunner` can pass a version of it that uses its separate
logger and not `globals`. In order to support this, classes up the stack
also provide a `Terminal`, `Platform`, and `OutputPreferences`.
- Fixes up use of `globals` from an earlier change to implement hot
reload to use the logger instead. Same with `globals.platform`.
- Adds tests to check that only hot restart is printed when not using
the extra front-end flags, and both hot restart and hot reload is
printed when you are.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-02-14 19:57:53 +00:00
Jonah Williams
33a4c95de0
[flutter_tools] remove SkSL bundling and dump skp on compilation. (#162849)
SkSL precompilation was only ever beneficial for iOS. For other
platforms, we recommended against it as Skia generated shaders per
target architecture which could be invalid on other devices. It is no
longer possible to use Skia on iOS.

Delete all Skia shader bundling logic.

Fixes https://github.com/flutter/flutter/issues/80091
2025-02-10 16:54:02 +00:00
Alex Li
771b8a4197
🔊 [tool] Add a wirelessly connected device name as displayName (#160497)
An improvement for #144634.

A wirelessly connected device will displayed as `Target device 1
(wireless)` in various of places.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-10 20:51:34 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
Ben Konyi
d89e65d516
Replace custom RPCErrorCodes with RPCErrorKind from package:vm_service (#158379)
Removes duplicated constants and ensures consistency by using package:vm_service as a source of truth for RPC error codes for requests made with package:vm_service.
2024-11-11 15:18:09 +00:00
Jonah Williams
102cd01693
[flutter_tools] remove raster stats CLI option. (#152501)
The raster stats feature is being removed from devtools and the engine. Remove the CLI option as well.

Fixes https://github.com/flutter/flutter/issues/144191
Fixes https://github.com/flutter/flutter/issues/132169
2024-07-29 20:30:54 +00:00
Ben Konyi
33b402d24c
Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#152386)
This reverts commit 7cdc23b3e1.

The failure in the `native_assets_test` integration test on Windows was caused by the DevTools process not being shutdown by the `ColdRunner` when running the profile mode portion of the test. This resulted in the test being unable to clean up the project created by the test as DevTools was still holding onto a handle within the directory. This PR adds back the mistakenly removed DevTools shutdown logic in the `ColdRunner`.
2024-07-26 20:51:19 +00:00
auto-submit[bot]
7cdc23b3e1
Reverts "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#151781)
Reverts: flutter/flutter#146593
Initiated by: zanderso
Reason for reverting: Consistently failing `Windows_android native_assets_android` as in https://ci.chromium.org/ui/p/flutter/builders/prod/Windows_android%20native_assets_android/2533/overview 
Original PR Author: bkonyi

Reviewed By: {christopherfujino, kenzieschmoll}

This change reverts the following previous change:
This change is a major step towards moving away from shipping DDS via Pub.

The first component of this PR is the move away from importing package:dds to launch DDS. Instead, DDS is launched out of process using the `dart development-service` command shipped with the Dart SDK. This makes Flutter's handling of DDS consistent with the standalone Dart VM.

The second component of this PR is the initial work to prepare for the removal of instances of DevTools being served manually by the flutter_tool, instead relying on DDS to serve DevTools. This will be consistent with how the standalone Dart VM serves DevTools, tying the DevTools lifecycle to a live DDS instance. This will allow for the removal of much of the logic needed to properly manage the lifecycle of the DevTools server in a future PR. Also, by serving DevTools from DDS, users will no longer need to forward a secondary port in remote workflows as DevTools will be available on the DDS port.

There's two remaining circumstances that will prevent us from removing DevtoolsRunner completely:

 - The daemon's `devtools.serve` endpoint
 - `flutter drive`'s `--profile-memory` flag used for recording memory profiles

This PR also includes some refactoring around `DebuggingOptions` to reduce the number of debugging related arguments being passed as parameters adjacent to a `DebuggingOptions` instance.
2024-07-15 19:55:18 +00:00
Ben Konyi
f023430859
Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)
This change is a major step towards moving away from shipping DDS via
Pub.

The first component of this PR is the move away from importing
package:dds to launch DDS. Instead, DDS is launched out of process using
the `dart development-service` command shipped with the Dart SDK. This
makes Flutter's handling of DDS consistent with the standalone Dart VM.

The second component of this PR is the initial work to prepare for the
removal of instances of DevTools being served manually by the
flutter_tool, instead relying on DDS to serve DevTools. This will be
consistent with how the standalone Dart VM serves DevTools, tying the
DevTools lifecycle to a live DDS instance. This will allow for the
removal of much of the logic needed to properly manage the lifecycle of
the DevTools server in a future PR. Also, by serving DevTools from DDS,
users will no longer need to forward a secondary port in remote
workflows as DevTools will be available on the DDS port. This code is currently 
commented out and will be enabled in a future PR.

There's two remaining circumstances that will prevent us from removing
DevtoolsRunner completely:

 - The daemon's `devtools.serve` endpoint
- `flutter drive`'s `--profile-memory` flag used for recording memory
profiles

This PR also includes some refactoring around `DebuggingOptions` to
reduce the number of debugging related arguments being passed as
parameters adjacent to a `DebuggingOptions` instance.
2024-07-15 14:08:31 -04:00
Sigurd Meldgaard
21d996929b
Refactor BuildInfo to always require packageConfigPath (#150559)
Refactor warming up to #150196
2024-07-02 11:19:31 +02:00
Christopher Fujino
f89b4f151e
[flutter_tools] Catch rpc error in render frame with raster stats (#144190)
Fixes https://github.com/flutter/flutter/issues/143010. This is intended to be cherrypicked into the 3.19 and 3.20 releases.

Long-term, we should deprecate this feature: https://github.com/flutter/flutter/issues/144191
2024-02-28 18:54:18 +00: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
Dan Field
c417c4623c
Refactor ShaderTarget to not explicitly mention impeller or Skia (#141460)
Refactors `ShaderTarget` to make it opaque as to whether it's using Impeller or SkSL and instead has it focus on the target platform it's generating for.

ImpellerC includes SkSL right now whether you ask for it or not. 

The tester target also might need SkSL or Vulkan depending on whether `--enable-impeller` is passed.
2024-01-31 21:30:02 +00:00
Michael Goderbauer
68e346e41c
Remove outdated ignores from tool (#140467)
These were not ignoring anything (anymore).
2023-12-20 22:14:32 +00:00
Jonah Williams
d13cd8846e
[flutter_tools] remove VmService screenshot for native devices. (#135462)
* This is completely broken on the Impeller renderer, see: https://github.com/flutter/flutter/issues/135052
* Even on the Skia renderer, this gives a software rasterized screenshot which will absolutely look different from a native rendering screenshot.

I plan to remove this functionality from the engine.
2023-09-29 00:21:14 +00:00
Ian Hickson
d6bf1447f4
Update the tool to know about all our new platforms (#132423)
...and add a test so we remember to keep it in sync.
2023-08-24 21:54:59 +00:00
Michael Goderbauer
55b6f049a6
Enable unreachable_from_main lint - it is stable now!!1 (#129854)
PLUS: clean-up of all the unreachable stuff.
2023-07-06 00:09:01 +00:00
Kevin Moore
76e587bf78
flutter-tool: enum cleanup (#124760)
flutter-tool: enum cleanup
2023-04-14 01:55:05 +00:00
Loïc Sharma
8f62e34267
[Focus] Add run key command to dump the focus tree (#123473)
[Focus] Add run key command to dump the focus tree
2023-03-28 00:33:39 +00:00
Michael Goderbauer
fda9ecfef7
Remove 1745 decorative breaks (#123259)
Remove 1745 decorative breaks
2023-03-22 21:12:22 +00:00
Zachary Anderson
7e88acfb0e
[flutter_tool] Adds a flag to disable Impeller (#122960) 2023-03-20 22:23:23 -07:00
Jesús S Guerrero
edd466811d
Disable jank metrics for web (#109356) 2022-08-11 19:58:06 +00:00
Jonah Williams
7e683c023a
[flutter_tools] add tool support for shader hot reload (#107963) 2022-07-27 03:31:06 +00:00
Michael Goderbauer
8a7b35933c
flutter update-packages --force-upgrade + analyzer fix (#108198) 2022-07-25 10:10:31 -07:00
Jonah Williams
db829c1e20
[flutter_tools] migrate more unit tests to null safety (#106153) 2022-06-17 21:34:27 -07:00
Jesús S Guerrero
889a15eb9d
[flutter_tools] add needsFullRestart flag on hot runner (#104562) 2022-06-03 10:18:16 -07:00
Michael Goderbauer
3fa355c97d
Remove dead code in tools tests (#104567) 2022-05-25 12:48:17 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint (#91409)" (#91461)
This reverts commit 5fd259be24.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint (#91409) 2021-10-07 20:13:02 -07:00
Ian Hickson
2bab6514b0
Enable avoid_implementing_value_types lint (#91078) 2021-10-04 13:48:04 -07:00
Alexandre Ardhuin
80990c21e2
code formatting (#85783) 2021-07-07 23:06:05 -07:00
Ahmed Ashour
529a599ce6
Fix some indentation (#84967) 2021-07-01 13:41:04 -07:00
Alexandre Ardhuin
34059eec2c
enable lint prefer_interpolation_to_compose_strings (#83407) 2021-06-01 11:14:06 -07:00
Jonah Williams
5c09eecd0d
[flutter_tools] remove special casing of web listview requests (#82826) 2021-05-18 13:19:03 -07:00
Kenzie Schmoll
766b4509c6
Add 'v' hotkey to open DevTools in the browser (#82227)
* Add 'v' hotkey to open DevTools in the browser
2021-05-13 09:54:10 -07:00
Phil Quitslund
61c30c41b2
fix sort_directives violations (#80817) 2021-04-21 13:49:03 -07:00
Jonah Williams
fdda777e34
[flutter_tools] support screenshot on all device types (#80616)
Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
2021-04-20 15:48:26 -07:00
Jonah Williams
c09ace2724
[flutter_tools] Remove web specific vm_service handlers, move handler tests to single location (#80440) 2021-04-18 09:24:02 -07:00
Jonah Williams
9904a7f472
Refactor core resident runner logic (#80462) 2021-04-16 17:27:35 -07:00
Jenn Magder
23e41734e5
Swap Mocks to Fakes in config_test (#76274) 2021-02-18 00:46:02 -08:00
Ian Hickson
b1cc48748d
Only write the pid-file while listening to SIGUSR signals. (#74533) 2021-02-10 16:06:05 -08:00
Ian Hickson
8acac060bf
Remove the timeout when launching DevTools (#74859) 2021-02-01 16:06:02 -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
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
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
Ben Konyi
89ef88c64f
Ensure attaching to an application with an existing DDS instance is not treated as a fatal error (#70847) 2020-12-04 17:16:30 -08:00