Commit graph

304 commits

Author SHA1 Message Date
Jonah Williams 6eaaf1650e
[flutter_tools] switch order of injection (#61191)
Inject loggers in the right order, test WIP. Otherwise verbose machine would not get the AppRunLogger
2020-07-09 18:04:37 -07:00
Jonah Williams ed9a705ec2
[flutter_tools] allow unmuting of command logging (#61198)
Running flutter doctor -v prints out extra details instead of running in verbose mode. Allow disabling this with -vv so it can be debugged.
2020-07-09 17:55:53 -07:00
Jonah Williams d4589e0c71
[flutter_tools] ensure AppRunLogger is injected for run/attach machine (#61103)
run/attach --machine requires a different logger than daemon, which uses the NotifyingLogger. We have too many loggers!

Fixes #59463
2020-07-08 18:21:46 -07:00
Jonah Williams e1538d1b88
[flutter_tools] last pass on general.shard unit tests (#60263)
Last batch of test fixes for general shard.
2020-06-26 13:36:06 -07:00
Jonah Williams a0334fb500
[flutter_tools] maintain file manifest for create (#59706)
First pass at fixing #57985 and implementing #59602

This doesn't have enough metadata to be useful for IDEs yet, but it prevents the issue from getting worse while we iterate on it.
2020-06-24 16:20:21 -07:00
Jonah Williams f8c9e1bb67
[flutter_tools] de-flake integration tests (#60221)
The vm_service_integration test flake is caused by trying to call the method before the framework is initialized (and the extension added). The run errors failure is caused by the error taking some time to propagate to the harness
2020-06-24 12:14:58 -07:00
Anna Gringauze aac836c6ad
Enabled expression evaluation by default (#59826) 2020-06-19 15:23:03 -07:00
Helin Shiah f7a09bd2df
Add integration tests for structured error (#59809) 2020-06-19 13:58:03 -07:00
Jonah Williams e1f4cfb4f4
[flutter_tools] add toggle b and service extension to change platform brightness (#59571)
A frequent request from the last Flutter developer survey was for an easier method of testing light/dark mode changes. Currently, a user needs to manually change the theme settings or adjust phone settings to see the difference. Instead we should add a toggle from the CLI, and eventually devtools/Intellij/Vscode that allows developers to override the current setting.

Fixes #59495

Adds flutter.ext.brightnessOverride service protocol which either queries the current platform brightness, or overrides it to a new value. This accepts either Brightness.light or Brightness.dark as a value.

Adds a CLI toggle b which allows the setting to be toggled manually.

Requires an update to the MediaQuery, to conditionally use a debug override when not in release mode
2020-06-18 10:32:43 -07:00
Per Classon 56a7dacd46
[flutter_tools] For l10n with deferred loading, use loadLibrary for non-web too (#59539)
After Dart VM change we are now required to use loadLibrary on an import whenever it is imported as deferred.

See: https://dart-review.googlesource.com/c/sdk/+/149613
2020-06-16 13:36:28 -07:00
Jonah Williams 15154b115f
[flutter_tools] deprecate build aot (#59487)
This command was previously used by the re-entrant build scripts in xcode_backend.sh and build.gradle. These have since been refactored to use flutter assemble.

Deprecation the command in preparation for removal in a future release of flutter. The only current use is a test on HHH
2020-06-16 13:00:11 -07:00
Jenn Magder 222c2cb0cc
Deprecate make-host-app-editable (#59217) 2020-06-11 11:37:15 -07:00
Jonah Williams d911eadf95
[flutter_tools] create NotifyingLogger at the top level when running flutter run --machine or flutter attach --machine (#59087)
Removes dependency on injecting additional logger with zones
2020-06-09 15:39:27 -07:00
Jonah Williams d0abf7f90f
[flutter_tools] don't use verbose when in doctor or help command (#58798) 2020-06-05 10:12:11 -07:00
Jonah Williams f5de6aadd4
[flutter_tools] remove zone level overrides of verbose and daemon logging (#57448)
Make it possible for all FlutterCommands to be global free, by moving instantiation to inside the Zone context. Additionally, provide VerboseLogger and NotifyLogger (daemon) at the top level and remove from command-specific overrides.

This allows removing a work around where web devices needed to look up directly from the context in non-test code.

Technically the output preferences are still zone injected, but these will be moved soon as they were not being used correctly by the top level command (the injection comes after ArgParser reads the overflow values, causing numerous wrap issues)
2020-06-04 16:35:36 -07:00
Jonah Williams 600338286f
[flutter_tools] add vm service method to pull SkSL (#57813) 2020-05-27 10:10:41 -07:00
Jonah Williams ffc56ff735
[flutter_tools] hide all development tools (#57690) 2020-05-27 10:10:19 -07:00
Jonah Williams 70b889a9a3
[flutter_tools] reland: integrate l10n tool into hot reload/restart/build (#57510)
Reland: #56167
2020-05-18 12:47:18 -07:00
Zachary Anderson 533cd7a6d1
[flutter_tools] Delete system temp entries on fatal signals (#55513) 2020-05-14 14:27:02 -07:00
Anna Gringauze e88ef6d554
Updated dwds (and other packages) (#56958) 2020-05-13 09:07:09 -07:00
Jonah Williams d70d0913b2
Revert "[flutter_tools] integrate l10n tool into build/run (#56167)" (#56800)
This reverts commit f865ac7e25.
2020-05-09 17:50:46 -07:00
Jonah Williams f865ac7e25
[flutter_tools] integrate l10n tool into build/run (#56167)
* [flutter_tools] integration l10n tool

* add runtime skip to build system

* Update build_system.dart

* add links to issues, comments

* Update packages/flutter_tools/test/general.shard/build_system/build_system_test.dart

Co-authored-by: Shi-Hao Hong <shihaohong@google.com>

* Update packages/flutter_tools/lib/src/build_system/targets/localizations.dart

Co-authored-by: Shi-Hao Hong <shihaohong@google.com>

* Update localizations.dart

* switch to gen_l10n localizations

* fix tests

Co-authored-by: Shi-Hao Hong <shihaohong@google.com>
2020-05-08 12:06:15 -07:00
Zachary Anderson 6f0ed5e142
[flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
Devon Carew 3f9ede1311
fix the reload and restart service extension methods (#56240) 2020-05-04 11:34:02 -07:00
Jonah Williams ffcf1db3ca
[flutter_tools] reland migrate FlutterViews to package:vm_service (#55797)
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior.

- Updates tests that were previously mocking FlutterViews to use real views
- Moves the FlutterView cache from VM to FlutterDevice
- Catch SentinelException during Isolate.kill
2020-04-27 17:41:42 -07:00
Jenn Magder 958ab9336f
Revert "[flutter_tools] reland migrate FlutterView to new vmservice (#55774)" (#55788)
This reverts commit a18e6361cf.
2020-04-27 16:19:25 -07:00
Jonah Williams a18e6361cf
[flutter_tools] reland migrate FlutterView to new vmservice (#55774) 2020-04-27 15:54:59 -07:00
Jonah Williams 07c451fea9
Revert "[flutter_tools] migrate FlutterView to new vm_service (#55341)" (#55772)
This reverts commit 2e50fd75eb.
2020-04-27 14:26:56 -07:00
Jonah Williams 2e50fd75eb
[flutter_tools] migrate FlutterView to new vm_service (#55341)
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior.

- Updates tests that were previously mocking FlutterViews to use real views
- Moves the FlutterView cache from VM to FlutterDevice
- Catch SentinelException during Isolate.kill
2020-04-27 14:16:28 -07:00
Christopher Fujino 4552af155c
[flutter_tools] enable flutter upgrade to support force pushed branches (#55594) 2020-04-24 17:55:16 -07:00
Anna Gringauze 873b21ec04
fixed flutter pub get failure in tests (#55499) 2020-04-24 09:09:01 -07:00
Anna Gringauze bc1c1b2ff8
Add flag to enable expression evaluation for web (#55003)
* Add flag to enable expression evaluation for web

Added flag --web-enable-expression-evaluation to flutter run commmand
that enables expression evaluation from IDEs for web target. Disabled
by default.

Helps https://github.com/flutter/flutter/issues/54520

* Update packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart

Co-Authored-By: Jonah Williams <jonahwilliams@google.com>

Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2020-04-17 10:42:02 -07:00
Anna Gringauze b69b2a8c9e
Convert expression evaluation exceptions to errors (#54916) 2020-04-17 10:40:02 -07:00
Jonah Williams 159710ecc5
[flutter_tools] fix response format of flutterVersion, flutterMemoryInfo (#54786) 2020-04-14 15:37:49 -07:00
Jonah Williams 9cc69d47a5
[flutter_tools] support machine and coverage together but for real (#54692) 2020-04-13 19:00:02 -07:00
Shi-Hao Hong c16c3b0443
[gen_l10n] Expand integration tests (#54314) 2020-04-10 10:25:03 -07:00
Per Classon 4451ffca23
Add option for deferred loading to gen_l10n (#53824) 2020-04-09 03:57:01 -07:00
Shi-Hao Hong 5d63637e43
[gen_l10n] Fallback feature for untranslated messages (#53374)
* Generate methods using template resources if they do not exist in other locales

* Added a flag to either output of messages that have not been translated with detail into a file, or display a summary on the terminal.

* Add integration test for fallback message usage
2020-04-08 18:55:50 -07:00
Per Classon e8d2907595
[gen_l10n] Handle single, double quotes, and dollar signs in strings (#54185) 2020-04-07 12:21:02 -07:00
Shi-Hao Hong 4e811d2819
[gen_l10n] Fix plural parsing for translated messages (#53954) 2020-04-03 15:46:01 -07:00
Shi-Hao Hong 6837b0e353
[gen_l10n] Add scriptCode handling (#53868)
* [gen_l10n] Add scriptCode handling
2020-04-03 09:46:01 -07:00
Christopher Fujino 2396616e09
Support old and new git release tag formats (#53715) 2020-04-03 09:39:28 -07:00
Christopher Fujino 1a685e03a2
Improve downgrade-upgrade integration test (#53775) 2020-04-02 10:35:30 -07:00
Anna Gringauze 3a0d837741
Enable expression evaluation in debugger for web platform (#53595) 2020-04-02 10:26:03 -07:00
Shi-Hao Hong 19e7db585d
[gen_l10n] Escape special JSON characters in generateString utility function (#53605) 2020-04-01 11:16:01 -07:00
Jonah Williams 10571920c0
[flutter_tools] update to latest dwds API (#52936)
Should fix issues introduced in web-server device and allow loading org-dartlang-app URIs
2020-03-23 18:47:50 -07:00
Jonah Williams b7101b45f5
[flutter_tools] disable added integration test due to Cirrus flakes (#52782) 2020-03-17 19:07:22 -07:00
Jonah Williams 6884086e5c
[flutter_tools] Update to latest dwds APIs (#51004)
Update to latest dwds APIs, moving back to dwds driven hot restart and enabling future work on expression evaluation.
2020-03-17 17:29:53 -07:00
Shi-Hao Hong 183da8f837
[gen_l10n] Fix suppportedLocales list (#52448)
* Fix suppportedLocales list

* Refactor integration tests for gen_l10n tool to catch exceptions
2020-03-12 12:58:13 -07:00
Jonah Williams d98213c46f
[flutter_tools] reland: Update background isolates when performing hot reload/restart (#52479)
Reland of #52149
2020-03-12 12:48:05 -07:00
Zachary Anderson 04a1b78b75
Revert "[flutter_tools] Update background isolates when performing hot reload/restart (#52149)" (#52476)
This reverts commit edd03a1af8.
2020-03-12 09:02:31 -07:00
Jonah Williams edd03a1af8
[flutter_tools] Update background isolates when performing hot reload/restart (#52149)
When performing a hot restart, collect isolates without an attached flutter view and send a kill signal. These must have been spawned by running main, so restarting without removing them leads to isolate duplication.

When performing a hot reload, ensure that we send a reloadSources command to every isolate and not just uiIsolates.
2020-03-11 15:52:04 -07:00
Zachary Anderson 6c408a0567
Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#52021)
* Reland: [flutter_tool] Where possible, catch only subtypes of Exception

* Add armv7f to getIOSArchForName
2020-03-06 10:22:12 -08:00
Jonah Williams 35bf5ab5d0
[flutter-tools] add awaits to debug a potential timing issue (#52047) 2020-03-05 15:24:28 -08:00
Flutter GitHub Bot 9c5009b251
[gen_l10n] Escape quote characters in ARB files (#51952) 2020-03-04 20:41:03 -08:00
Jonah Williams cc52a903a8
[flutter_tools] add status logs to determine where test is getting stuck (#51984) 2020-03-04 18:59:18 -08:00
Jenn Magder cbbb7ec5a7
Revert "Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#51774)" (#51960)
This reverts commit 57c6721cd5.
2020-03-04 12:40:15 -08:00
Flutter GitHub Bot 57c6721cd5
Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#51774) 2020-03-04 11:41:02 -08:00
Zachary Anderson 914bd76979
[flutter_tools] Handle errors on the std{out,err}.done future (#51660) 2020-02-28 22:31:01 -08:00
Zachary Anderson b32ee2f15c
Revert "Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#51567)" (#51616)
This reverts commit 9de7787f25.
2020-02-27 22:57:13 -08:00
Zachary Anderson 9de7787f25
Reland: [flutter_tool] Where possible, catch only subtypes of Exception (#51567) 2020-02-27 22:46:23 -08:00
Jonah Williams 4e5cb2b299
[flake] attempt to de-flake hot reload test (#51608) 2020-02-27 18:30:42 -08:00
Jonah Williams fe1e8f3bb7
[flutter_tools] add logging to integration test (#51527) 2020-02-27 08:54:24 -08:00
Zachary Anderson 483f49962c
Revert "[flutter_tool] Where possible, catch only subtypes of Exception (#51440)" (#51539)
This reverts commit f1cd47ef5c.
2020-02-26 23:42:19 -08:00
Zachary Anderson f1cd47ef5c
[flutter_tool] Where possible, catch only subtypes of Exception (#51440) 2020-02-26 21:45:02 -08:00
Alexander Aprelev 0a9b358e3d
Fix expression evaluation test leaking flutter_tester processes. (#51496)
* Fix expression evaluation test leaking flutter_tester processes.

Let flutter_tester process complete, wait for it completion, kill the test only if didn't complete on time.

* Type annotation
2020-02-26 13:42:40 -08:00
Jonah Williams 53457c2241
[flutter_tools] Reland initialize frontend_sever with build (#51477) 2020-02-26 08:06:03 -08:00
Jonah Williams 421056ee54
Revert "[flutter_tools] initialize frontend server with build (#49405)" (#51476)
This reverts commit 59cc3cdf01.
2020-02-26 07:24:18 -08:00
Hans Muller 9b3754d56f
Extend the gen_l10n integration test (#51375) 2020-02-24 16:42:30 -08:00
Jonah Williams 59cc3cdf01
[flutter_tools] initialize frontend server with build (#49405) 2020-02-24 14:21:33 -08:00
Yegor b34046903b
Fix stack trace parsing on non-debug builds; add e2e tests (#50652)
* Fix stack trace parsing on non-debug builds; add e2e tests
2020-02-13 18:34:08 -08:00
Jonah Williams e2554a9202
Add "flutter downgrade" command (#50506) 2020-02-13 11:56:45 -08:00
Alexandre Ardhuin f15c887c63
change quote to avoid escapes (#50368) 2020-02-11 20:58:27 +01:00
Jonah Williams 58811028a4
[flutter] Allow hot reload replacements of Stateless/Stateful Widget (#48932) 2020-01-30 07:58:03 -08:00
Hans Muller 3f2c6ea724
Integration test for the gen_l10n tool (#49586) 2020-01-29 12:45:03 -08:00
Alexandre Ardhuin 4f9b6cf017
enable lint prefer_final_in_for_each (#47724) 2020-01-07 16:32:04 +01:00
Jonah Williams ee7a37f1d3
[flutter_tools] Ensure that global variables are easily identifiable (#47398) 2020-01-06 11:04:20 -08:00
Jonah Williams bda9d90804
[flutter_tool] Reland: support --fast-start for Android applications (as an opt-in) (#46140) 2019-12-10 10:26:14 -08:00
Jonah Williams 81aa2710d2
[flutter_tool] add a vmservice API for hot ui requests (#45649) 2019-12-09 21:31:34 -08:00
Jonah Williams 63cc4ad3aa
Revert "[flutter_tool] Prevent accidental calls to io.exit when asserts are active in unit tests (#46210)" (#46630)
This reverts commit b698c9d72e.
2019-12-09 13:13:59 -08:00
Jonah Williams b698c9d72e
[flutter_tool] Prevent accidental calls to io.exit when asserts are active in unit tests (#46210) 2019-12-09 13:01:37 -08:00
Jenn Magder d01de941b9
Revert "Support --fast-start for Android applications (as an opt-in) (#45431)" (#46138)
This reverts commit 2a113165c0.
2019-12-04 18:12:57 -08:00
Jonah Williams 2a113165c0
Support --fast-start for Android applications (as an opt-in) (#45431) 2019-12-04 17:34:25 -08:00
Ian Hickson 449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
Danny Tuppeny 459c7fb884
Resume isolate before terminating tests to prevent flutter_tester leaks in integration tests (#45248)
* Resume isolate before terminating tests to prevent flutter_tester leak

* Fix lint

* Catch exceptions from resume() as well as timeout()

* Formatting fixes

* Don't try to resume if there's no vm service

* Fix handling of timeouts to not leak futures
2019-11-26 17:04:51 +00:00
Alexandre Ardhuin 980f14e0c5
implicit-casts:false on flutter_tools (#45153)
* implicit-casts:false on flutter_tools

* use castStringKeyedMap

* address review comments

* address review comments

* fix issues after rebase
2019-11-24 06:54:43 +01:00
Jonah Williams 35b571ccfc
Revert "Improve time to development by initializing frontend_server concurrently with platform build (#45236)" (#45422) 2019-11-22 13:36:12 -08:00
Jonah Williams 60869e0a93
Improve time to development by initializing frontend_server concurrently with platform build (#45236) 2019-11-22 12:26:31 -08:00
Danny Tuppeny 73c32545b7
Fix device daemon test when desktop or web are enabled (#45172) 2019-11-20 11:02:35 +00:00
Yegor e7073f9a1f
add --dart-defines option (#44083) 2019-11-09 17:08:53 -08:00
chunhtai 7aebde1904
added new lifecycle state (#39945)
* added new lfecycle state

* update

* update
2019-11-05 20:03:09 -08:00
Ian Hickson 124dc6617f
Clean up test infrastructure (#43030)
See #41880 for history.
2019-10-18 16:35:39 -07:00
Jonah Williams 1982a5c3ec
Revert "Clean up test infrastructure (#41880)" (#42982)
This reverts commit 1781d5c9bb.
2019-10-17 19:47:16 -07:00
Ian Hickson 1781d5c9bb
Clean up test infrastructure (#41880) 2019-10-17 19:22:47 -07:00
Jason Simmons db9a035e7c
Wait for isolate start before proceeding with expression evaluation tests (#42464)
Fixes https://github.com/flutter/flutter/issues/42359
2019-10-11 11:04:39 -07:00
Danny Tuppeny e8c5d66b5a
Use processManager.run() instead of manually capturing streams in test_utils getPackages() (#41687)
* Capture stdout in test helper

* Simplify running getPackages() in test utils

* Remove unused import
2019-10-10 07:47:26 +01:00
Ian Hickson cdc2d9901d
More consistent temp directory naming (#42063)
Applying our style guide:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#have-good-hygiene-when-using-temporary-directories
2019-10-07 16:43:04 -07:00
Jonah Williams 39f85f94ec
Reland: don't update last compile time when compilation is rejected. (#41580)
* dont update last compiled time when compilation is rejected

* lets try flushing, thats a neat trick

* windows man

* Update hot_reload_test.dart

* Update hot_reload_test.dart

* Update devfs.dart

* Update hot_reload_test.dart

* Update hot_reload_test.dart

* add test that verifies when compile is good that time is updated

* Update devfs_test.dart
2019-10-02 12:46:33 -07:00
Alexandre Ardhuin f11c34109c
fix bad indentations(mainly around collection literals) (#41355) 2019-09-27 10:46:45 +02:00
Zachary Anderson e2340c641d
[flutter_tool] Use curly braces around single statment control structures (#40446) 2019-09-13 14:51:35 -07:00
Yegor 9bc298deb6
update dependencies; add a Web smoke test (#37816)
update dependencies; add a Web smoke test
2019-08-09 09:58:49 -07:00
Ian Hickson e8d7306828
Some minor cleanup for flutter_tools (#36569) 2019-07-24 10:58:09 -07:00
Danny Tuppeny d42d0c5171
Re-enable flutter test expression evaluation tests (#36431)
Plus:

- Resume the app being run after expression has been evaluated to prevent the test run being forcefully terminated because it didn't end
- Skip non-JSON when waiting for JSON (eg. when running in verbose mode for debugging locally)
- Pass defaultTimeout in waitForJson (otherwise the assert in _timeoutWithMessages fails when it's not provided)

Closes https://github.com/flutter/flutter/issues/26518 (the original reason for skip was fixed in https://github.com/dart-lang/sdk/issues/34224).
2019-07-22 19:43:37 +01:00
Ian Hickson d919e694b8
Move tools tests into a general.shard directory in preparation to changing how we shard tools tests (#36108) 2019-07-13 11:51:44 -07:00