Commit graph

4552 commits

Author SHA1 Message Date
gaaclarke fa646339d6
Added the machine's architecture to macos doctor results. (#65978) 2020-09-16 17:47:04 -07:00
Jonah Williams 73652a723b
[flutter_tools] automatically update to latest sw on install (#65784)
If a new service worker is installed, automatically update this behind the scenes. Immediately after a page refresh, the new worker and cache will be available, though the main.dart.js and others will be available sooner due to the cache busting URLS
2020-09-16 17:16:58 -07:00
Ben Konyi a17b330980
Reland "Re-enable the Dart Development Service (DDS) (#64671)" (#65873)
This reverts commit 66b01c1f29.

* Add DDS ipv6 support

* Use --dds-port for DDS instead of hijacking --host-vmservice-port
2020-09-16 16:27:42 -07:00
Michael R Fairhurst 7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
Devon Carew 04e4b117f6
fix an issue where raw json output is written to IDE clients (#65508)
fix an issues where raw json output was written to IDE clients
2020-09-15 12:44:05 -07:00
Balvinder Singh Gambhir 3dde3e034c
[flutter_tools] generates version.json for web using flutter tool (#64644)
Generates version.json in web directory of project. version.json can be used in the future version of package_info which will support web. version.json has the following keys : app_name, version and build_number. This file is generated every time a user runs or builds the project.

Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2020-09-15 11:21:54 -07:00
Yuqian Li e3c6979d1b
Save startup timeline (#65118)
This would help us investigate issues like
https://github.com/flutter/flutter/issues/64781
2020-09-15 11:17:30 -07:00
Jonah Williams 4188085596
[flutter_tools] handle archive exception from invalid zip signature (#65869)
Like the ProcessException thrown from zip running on a bad file, the tool should catch the ArchiveException thrown from windows implementation using package:archive.
2020-09-15 10:55:41 -07:00
Aman Verma 9dd6738662
Update flutter_command.dart (#65765) 2020-09-14 18:02:09 -07:00
stuartmorgan bcd0959ac3
Sort generated plugin file content by plugin name (#65509) 2020-09-14 17:57:11 -07:00
Jonah Williams 039f1cf853
[flutter_tools] handle terminals that do not support single char mode in Terminal.promptForCharInput (#65418)
Some terminals stdin do not support single char mode (like an emacs terminal buffer apparently). If this is the case, then the presented choice values would always have an appended newline \n which would prevent us from finding the value in the listed index (or using it as a signal for the default choice). To fix, treat '' as the default choice and always trim the choice value.

While this has seemingly always been broken, it wasn't noticeable until the multi-device selection prompt was added a few months ago.

Fixes #65267
2020-09-14 17:57:04 -07:00
Jonah Williams 6acea15f22
[flutter_tools] fix failure to create ansi spinner if download needs to be retried (#65797)
Because the Status spinner was only created on setup, the second stop would asset/crash.

Fixes #65449
2020-09-14 17:55:11 -07:00
Greg Spencer 94592acb71
Creates a way to test private APIs in the Flutter package. (#65505) 2020-09-13 15:52:03 -07:00
Danny Tuppeny 92eb7945a5
Remove invalid assert (#65623) 2020-09-11 15:35:04 -07:00
Ben Konyi 577de1c44e
Roll forward package:test to 1.16.0-nullsafety.4 to prepare for (#65571) 2020-09-10 15:55:03 -07:00
Jonah Williams 0ea0e9d0b3
[flutter_tools] remove advice about running sdkmanager directly (#65426) 2020-09-10 13:05:03 -07:00
Herbert Poul 8dfd42f6b7
[gen_l10n] Support string list as preferred-supported-locales (#63649)
* [gen_l10n] Support string list as preferred-supported-locales, as documented.

* [gen_l10n] Convert preferredSupportedLocale to a list of strings. 

* [gen_l10n] Accept a multi option instead of a json string in the command line.
2020-09-10 07:32:40 +08:00
stuartmorgan 6d1c244b79
Always use POSIX paths for generated CMake files (#65493)
The Windows plugin CMake generation had code to ensure that the paths
written to it used POSIX separators, but the Linux version didn't; that
meant that plugin updates run on Windows machines would corrupt the
generated (but checked in) Linux CMake file.

This change shares that code so that both will use POSIX paths
regardless of what OS they are generated on.

Fixes https://github.com/flutter/flutter/issues/64591
2020-09-09 16:08:19 -07:00
Jonah Williams 6d360562e3
[flutter_tools] alternate the name of the dill file used for hot restart (#65435)
* [flutter_tools] alternate the name of the dill file used for hot restart

* switch alternative name to .swap
2020-09-09 15:56:25 -07:00
Jonah Williams b4551e31fc
[flutter_tools] remove globals from tracing and add unit tests (#65490)
Removes global variables and adds unit tests that can be copied for #65118
2020-09-09 15:55:52 -07:00
Angjie Li d2fa384c31
Allow Developers to enable Accessibility testing on WebFlutterDriver and get the underlying webDriver (#65051) 2020-09-08 13:15:06 -07:00
Jonah Williams 9248fda410
[flutter_tools] add EACCES to list of immediate exit tool conditions (#65125)
Similar to the permission denied error on Windows, this is not resolvable by the tool.
2020-09-03 16:08:01 -07:00
Jonah Williams 30a0b5a50c
Revert "[flutter_tools] split project parsing/validation into separate function (#64814)" (#65202)
This reverts commit 8eed690442.
2020-09-03 14:25:29 -07:00
Jonah Williams 8eed690442
[flutter_tools] split project parsing/validation into separate function (#64814)
In order to share logic across build/archive/ipa commands, move the project parsing/validation into a different function. #64683
2020-09-03 14:14:52 -07:00
Jonah Williams 418681d6f1
[flutter_tools] allow disabling pwa from build command, fix run release build caching (#64587)
Fix run release/profile modes generating a full service worker.
2020-09-03 13:42:47 -07:00
Jaime Blasco 0699c18e99
[flutter_tool] [web] Remove x-frame-options header during debug (#62115)
Currently flutter run -d web creates a server with the x-frame-options: SAMEORIGIN added by default (shelf add it's by default). This doesn't allow you to use it inside a frame.

I am trying to build an embedded simulator in vscode and it requires using an iframe.

With this PR I remove the header for debug and profile mode.
2020-09-03 13:33:39 -07:00
Jonah Williams bd3eee75f3
[flutter_tools] rethrow process exceptions as tool exit from gradle build (#64745)
The flutter tool is currently unable to detect missing permissions in gradle/gradle.bat that would cause a gradle build to fail via process exception. Rather than crashing and exiting, we can display the exception as an error message and tool exit.

While linux/macOS are able to add the +x bit, this is not possible on windows with our current file system/OS API. These crashes represent a substantial amount of crash reporting, but are otherwise not actionable on our end.
2020-09-03 11:55:55 -07:00
Jonah Williams 08e3ed9e2d
[flutter_tools] prevent creation of android devices if adb is not located (#65184)
More work to prevent current #2 crash issue on stable. If adb is not located do not list/create android devices.
2020-09-03 11:01:43 -07:00
Shi-Hao Hong b80b432555
Move gen_l10n into flutter_tools (#65025) 2020-09-03 09:26:58 -07:00
Jonah Williams c034f1a1cc
[flutter_tools] fix screenshot command in release mode and help documentation (#65114)
Currently taking a screenshot in release mode crashes and is also not documented as a supported command. Fix both of these and add test cases.
2020-09-02 17:33:41 -07:00
includecmath 6d46ff7e9b
[flutter_tools] flutter run should allow exit when make choose for devices. (#64403) 2020-09-02 17:30:04 -07:00
Jonah Williams d3fd62c843
[flutter_tools] exit with helpful message if where is missing on windows (#65112) 2020-09-02 16:50:04 -07:00
Jenn Magder 6175183545
Add --device-timeout flag to device-related commands (#64834) 2020-09-02 15:38:52 -07:00
stuartmorgan 6eef5f2c5f
Share build command flag configuration on desktop (#64983)
Almost all of the flag setup on Linux, macOS, and Windows should be
identical; this pulls that common setup to a shared method.

This adds support for several flags on macOS that have all the necessary
plumbing already in place due to shared backend code, but were never
enabled.

Fixes https://github.com/flutter/flutter/issues/64944
2020-09-01 10:21:51 -07:00
Jonah Williams 216da410a8
[flutter_tools] add --config-only option to flutter build ios (#64848) 2020-08-31 17:23:03 -07:00
Jonah Williams 183a653e37
[flutter_tools] adjust index.html caching and insert cache busting URL in to main.dart.js/sw request (#64976)
Attempt to bypass aggressive CDN by requesting main.dart.js/sw.js with a query param and defaulting index.html to online first. This will not stop aggressive CDN caching of the index.html

#64968
2020-08-31 17:22:42 -07:00
Mehmet Fidanboylu 66b01c1f29
Revert "Reland "Re-enable the Dart Development Service (DDS) (#64671)" (#64847)" (#64981)
This reverts commit c8f234d365.
2020-08-31 16:09:02 -07:00
Jonah Williams 15d18b9e42
[flutter_tools] remove unused zip verification (#64970)
This is no longer used, in favor of just attempting to unzip and handling the exception.
2020-08-31 13:26:38 -07:00
Jonah Williams 68b39da346
[flutter_tools] tool exit after repeated network failure (#64878)
Exit the tool after a repeated network error to download. previously we were returning null and continuing on, leading to a ProcessException when we unzipped a missing file.
2020-08-31 12:15:05 -07:00
Ben Konyi c8f234d365
Reland "Re-enable the Dart Development Service (DDS) (#64671)" (#64847)
This reverts commit 2436de1391.
2020-08-31 12:14:32 -07:00
ekibun 719268b43a
add different workload & add -products * to vswhere calls to check both Visual Studio IDE and standalone Build Tools. (#64251) 2020-08-31 09:33:04 -07:00
Shi-Hao Hong fd22fc3e35
[gen_l10n] Synthetic package generation by default (#62395)
* synthetic packages by default in gen_l10n tool

* Refactor default path for synthetic package

* Remove unused import

* Code cleanup

* Further improvements to help text

* Refactor synthetic package path

* Remove newlines

* Test cleanup

* clean up logic in inputs and outputs list function

* Update l10n.yaml usage

* only add option if value is non-null

* Update stocks app as proof of concept for synthetic package usage

* Address nits

* print pubspec contents

* add print statements

* Do not allow null value for useSyntheticPackage

* +

* +

* +

* +

* Cleanup

* Add test

* Fix text

* Dont parse pubspec directly

* Test using context

* WIP: generate synthetic packages on pub get -- needs tests

* Allow null value

* Update null handling

* Refactor to properly handle null case

* Fix yamlMap condition

* Fix yaml node for real

* WIP: struggling to write tests

* WIP - take absolute path as an option

* Add tests

* Use environment project directory for synthetic package generation pathway

* Fix typo

* Improve help text

* Update defaults

* Remove unauthorized path import

* Fix pathing issues at synthetic package generation

* Fix typo in test

* Use path.join so projectDir matches up based on OS

* Fix Windows pathing in test

* Remove unnecessary replaceApp code for projectDir.path

* Use globals.fs.currentDirectory.path in resident_runner_test.dart

* Fix merge conflict

* Add test to ensure that synthetic package is generated on pub get

* Fix resident_runner_test.dart tests

* Fix tests

* Use package:file instead of dart:io

* WIP - exploration

* Remove synthetic package use from stocks example

* Update integration test to not use synthetic packages

* Remove trailing whitespace

* flutter pub get runs synth package generation

* Remove more print statements

* Add license header

* WIP - minimally working pub.get

* Use own MockBuildSystem

* Modify test and implementation to be a little cleaner

* Fix flutter pub get invocation

* Use synthetic packages in stocks app

* Revert "Use synthetic packages in stocks app"

This reverts commit 45bf24903c.

* Add environment and buildSystem params to flutter test

* Address code review feedback

* +

* Isolate codegen into its own API

* Fix imports

* Slight refactor

* Add one more test for no l10n.yaml file

* Remove unneeded mock class and import in pub_get_test.dart

* More code review feedback

* Remove unnecessary imports

* Remove `return await`s that I missed

* use arrow functions instead
2020-08-31 13:19:41 +08:00
Jonah Williams 2436de1391
Revert "Reland "Re-enable the Dart Development Service (DDS) (#64671)" (#64802)" (#64845)
This reverts commit eef0050d08.
2020-08-28 18:02:15 -07:00
Ben Konyi eef0050d08
Reland "Re-enable the Dart Development Service (DDS) (#64671)" (#64802)
* Reland "Re-enable the Dart Development Service (DDS) (#64671)"

This reverts commit 2ae25cc2d7.

* Fix MDNS building Observatory URI with port 0 instead of forwarding the device port

* Added MDNS test
2020-08-28 16:18:35 -07:00
Ben Konyi 2ae25cc2d7
Revert "Re-enable the Dart Development Service (DDS) (#64671)" (#64797)
This reverts commit d7d12412e5.
2020-08-28 09:00:53 -07:00
Jonah Williams 5a4fa220e2
[flutter_tools] handle OsError thrown during azure detector (#64749) 2020-08-27 17:13:04 -07:00
Ben Konyi d7d12412e5
Re-enable the Dart Development Service (DDS) (#64671)
This change re-enables DDS and outputs the DDS URI in place of the VM
service URI on the console. If --disable-dds is not provided,
--host-vmservice-port will be used to determine the port for DDS rather
than the host port for the VM service, which will instead be randomly
chosen.
2020-08-27 16:35:00 -07:00
Jonah Williams d3515f5fb6
[flutter_tools] add analytics to code size, add more testing (#64578)
* [flutter_tools] add analytics to code size, add more testing

* add gradle case

* Update build_macos_test.dart

* move analytics to code size tooling

* Update analyze_size.dart

* fix analysis
2020-08-27 09:45:10 -07:00
Jonah Williams 401d401c59
[flutter_tools] reland: avoid creating Android Devices if AndroidSDK cannot be found (#64665)
Avoid creating AndroidDevice discovery if the SDK cannot be located. Previously the tool would use which/where adb, however this required us to handle the AndroidSdk class being potentially null - which required an additional layer of indirection around all access. Sometimes these were forgotten leading to NPEs.

In general, not much can be done with an Android Device if the actual SDK is not installed.

Reland with fixed code + tests for null SDK + adb in AndroidDeviceDiscovery
2020-08-27 09:44:31 -07:00
Jonah Williams 562986108e
Revert "Reland: Increase threshold for usage of compute for utf8 decoding on large strings to 50 KB (#64498)" (#64652)
This reverts commit 54e2a0e694.
2020-08-26 10:51:09 -07:00