Commit graph

6041 commits

Author SHA1 Message Date
Robert Ancell 16b9933d85
Disable header bar when not using GNOME Shell. (#68452)
Fixes https://github.com/flutter/flutter/issues/68253
2020-10-22 10:24:19 +13:00
Robert Ancell b200baebd7
Try the Wayland GDK backend, the engine now supports it (#66519)
* Try the Wayland GDK backend, the engine now supports it

* Update comment from review

* Just do default GTK behaviour
2020-10-22 09:38:11 +13:00
Zachary Anderson cbcd1321ed
Revert "enable unnecessary_string_escapes and use_raw_strings (#68302)" (#68714)
This reverts commit ae06c19a37.
2020-10-21 08:16:13 -07:00
Alexandre Ardhuin ae06c19a37
enable unnecessary_string_escapes and use_raw_strings (#68302) 2020-10-21 16:34:24 +02:00
Jenn Magder d29cd9beb6
Clean up device logger and port forwarding on drive completion (#68655) 2020-10-20 16:01:51 -07:00
Jonah Williams cb5865d86c
[flutter_tools] add some versions to tool sources, cleanup build.yaml (#68624) 2020-10-20 09:50:31 -07:00
Jenn Magder d81691d0f4
Revert "Build iOS apps using Swift Packages (#68361)" (#68546)
This reverts commit dd9323bdfb.
2020-10-19 17:57:32 -07:00
Yegor ea3b08f333
Respond to HTTP POST requests with 404 in WebAssetServer (#68492)
* Respond to POST with 404 in WebAssetServer
2020-10-19 16:21:39 -07:00
Jenn Magder dd9323bdfb
Build iOS apps using Swift Packages (#68361) 2020-10-19 15:47:04 -07:00
Jenn Magder 5e17a240bd
Generate only requested platform directories on create (#68376) 2020-10-19 14:17:43 -07:00
Jonah Williams e422d5c724
[flutter_tools] reland: --no-android-gradle-daemon in devicelab (#68491)
Remove devicelab specific code for shutting down gradle daemon, add --android-gradle-daemon option to build/run/drive`. Avoids need for un-tested devicelab specific handler. There are also some feature requests for this, so 2 birds one stone.

Example:

flutter build apk --no-android-gradle-daemon will pass --no-daemon on to gradle
2020-10-19 10:27:58 -07:00
Jonah Williams 19f363029e
[flutter_tools] increase devFS sync timeout to 60 seconds (#68488)
The current timeout is too short for some remote workflows. The existing unit test require hitting a real timeout so I've removed it.

See b/171005910
2020-10-19 10:14:37 -07:00
Jonah Williams ed5482de19
Revert "[flutter_tools] add --android-gradle-daemon option, use in devicelab (#68409)" (#68489)
This reverts commit ddab72e79f.
2020-10-19 09:33:52 -07:00
Jonah Williams ddab72e79f
[flutter_tools] add --android-gradle-daemon option, use in devicelab (#68409)
Remove devicelab specific code for shutting down gradle daemon, add --android-gradle-daemon option to build/run/drive`. Avoids need for un-tested devicelab specific handler. There are also some feature requests for this, so 2 birds one stone.

Example:

flutter build apk --no-android-gradle-daemon will pass --no-daemon on to gradle
2020-10-19 09:12:21 -07:00
Nobuhiro Tabuki 4e2f82cf93
[flutter_tools] change the IntelliJ plugin detection logic. (#68020)
This PR suggests improving the IntelliJ plugin "jar" detection logic.

Previously:
The IntelliJ Flutter plugin was contained flutter-intellij.jar.
Currently:
It is named flutter-intellij-X.Y.Z.jar and does not contain META-INF/plugin.xml.
META-INF/plugin.xml is included in flutter-idea-X.Y.Z.jar.

So this PR changes the rules for searching the plugin's jar file.
Concretely, it looks for the jar file containing META-INF/plugin.xml in the plugin's package directory and reads the package version from its META-INF/plugin.xml.

Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2020-10-19 08:19:48 -07:00
Michael Thomsen c97ea71798
Adjust constraints (#68437) 2020-10-19 17:17:13 +02:00
Lau Ching Jun 583db83865
request.mainUri should be fileUri (#68329) 2020-10-16 15:23:54 -07:00
Jonah Williams 198e40c9eb
[flutter_tools] retry the driver launch of the application up to 3 times. (#68334)
We'd like to see how many of these flakes are transient and how many involve the device/machine getting temporarily wedged. Add a retry with no delay to see if it is possible to add sufficient error handling to startApp/installApp to handle this.
2020-10-16 15:07:23 -07:00
Lau Ching Jun 3393566b56
Use multiroot scheme for initial compilation in ResidentRunner recompile (#68280) 2020-10-16 10:54:19 -07:00
Jonah Williams dd93ee301f
[flutter_tools] drive uses correct application package for prebuilt (#68309)
Both start and stop app create an application package, but only start app used the application binary. Create the application package once and pass it to both start and stop app.
2020-10-16 09:40:08 -07:00
Martin Kustermann 6fae89c8b5
Update package:stack_trace dependency to 1.10.0-nullsafety.4 (#68132) 2020-10-16 16:35:20 +02:00
Alexandre Ardhuin 4ce5c2713b
fix the tree (#68277) 2020-10-16 10:28:38 +02:00
Shi-Hao Hong 38ebc5588b
[gen_l10n] Create pubspec.yaml in ".dart_tool/flutter_gen" if it does not already exist (#68206)
* Generate pubspec.yaml for synthetic package if it did not exist prior
2020-10-16 11:34:27 +08:00
Jenn Magder acde65d14a
Revert noninteractive lldb debugging, timeout warning (#68245) 2020-10-15 18:02:15 -07:00
Jonah Williams 4ce27ea0ac
[flutter_tools] update metadata detection to account for invalid yaml (#68243) 2020-10-15 16:51:52 -07:00
Jay Freeman (saurik) a69e393d66
Avoid skipping variable initialization using case. (#67899) 2020-10-15 16:07:03 -07:00
Alexandre Ardhuin 73301a35a2
Sync lints (#68136) 2020-10-15 15:37:04 -07:00
Jonah Williams 0f88644883
[devicelab] allow the devicelab to take a screenshot if the iOS connection fails with FLUTTER_IOS_SCREENSHOT_ON_CONNECTION_FAILURE (#68156)
More attempts to remote diagnose the issues in the iOS devicelab
2020-10-15 13:13:28 -07:00
Jonah Williams 27936e9f22
Revert "[flutter_tools] ensure android log reader works in flutter drive (#68131)" (#68222)
This reverts commit d962c8f2a2.
2020-10-15 10:50:56 -07:00
Jonah Williams 2321b72dfb
[flutter_tools] move gradle download failure handling into tool (#68140)
This crash affects anyone using flutter, so move it into the tool where it can be tested and documented. Ensure it works on windows devicelab too.
2020-10-15 09:20:52 -07:00
Jenn Magder 1fb94fb894
Noninteractive iOS debugger session (#68145) 2020-10-14 15:38:07 -07:00
Jenn Magder a82807d782
Run Xcode command lines tools in native ARM (#68050) 2020-10-14 15:24:32 -07:00
Jonah Williams d962c8f2a2
[flutter_tools] ensure android log reader works in flutter drive (#68131) 2020-10-14 14:04:33 -07:00
Jenn Magder 537cf33a21
Move processUtils to globals (#67976) 2020-10-14 13:12:46 -07:00
Jonah Williams 767fb98a7b
[flutter_tools] partial revert of start app change (#68128)
* [flutter_tools] partial revert of start app change
2020-10-14 12:20:30 -07:00
Jenn Magder 431c599bec
Revert "[flutter_tools] If run fails to install the application on iOS, try uninstalling it and trying again. (#68078)" (#68118)
This reverts commit 61ba7dd218.
2020-10-14 10:07:30 -07:00
Jonah Williams 61ba7dd218
[flutter_tools] If run fails to install the application on iOS, try uninstalling it and trying again. (#68078) 2020-10-14 09:14:36 -07:00
Jonah Williams 4b351ac1b4
[flutter_tools] do not allow attaching in release mode (#68071)
Do not allow attach in release mode, as there is not VM Service to connect to. Observed in crash reporting as thrown string which is changed to exception below.
2020-10-13 21:29:23 -07:00
Jonah Williams 751459df24
[flutter_tool] support --use-application-binary in flutter drive (#68060)
--use-application-binary allows running with an already built APK. This can be useful for speeding up CI test cases, or in our case eventually supporting some sort of build server. Demonstrate that this works by updating the old gallery test to use it. Fixes #56604

Co-authored-by: Jenn Magder <magder@google.com>
2020-10-13 19:27:30 -07:00
Jonah Williams 9e70180f63
[flutter_tools] do not measure progress timeout (#67959)
Remove "This is taking a long time" progress timeout and TimeoutConfiguration.
2020-10-13 13:05:47 -07:00
Jenn Magder 3e0d2741de
Detach debugger when VM connection fails on iOS (#68046) 2020-10-13 12:50:50 -07:00
Jenn Magder 4dffc851bc
Detect ARM macOS arch with sysctl hw.optional.arm64 (#67970) 2020-10-13 12:05:04 -07:00
Jonah Williams d6d06ed9f0
[flutter_tools] delete applicationPackageStore (#68026)
This class is entirely superseded by the application package factory. Only drive and install use it, and removing it from drive will allow use-application-binary support.
2020-10-13 11:33:55 -07:00
Jonah Williams 1c976933f3
[flutter_tools] support Android Studio 4.1 on Windows (#67992)
Android Studio 4.1 moved the location of the .home file on Windows which is used to located the install directory. This functionality is important because it is how we locate and discover the Android SDK functionality, as well as the appropriate JRE.

fixes #67986
2020-10-13 11:33:26 -07:00
Nobuhiro Tabuki 1e180062aa
[flutter_tools] Support IntelliJ 2020.1 and later on Linux and Windows (#58853)
This PR will update IntelliJ IDEA/Community validation logic for 2020.1 and later on Linux and Windows.
2020-10-12 22:03:36 -07:00
Jonah Williams ac751cc50c
[flutter_tools] verify checksum of downloaded artifacts (#67839)
All of the network requests from google cloud storage include an x-goog-hash header which contains an MD5 checksum. If present, use to validate that the downloaded binary is valid. This will rule out corrupt files as the cause of getting started crashers in the flutter_tool.

#38980

This does not fully resolve the above issue, because while we can check if the checksum matches what was expected from cloud storage, this A) may not necessarily be present and B) may not match up to what should be uploaded as part of the engine build process.

But when life gives you lemons you hash those lemons using an outdated hashing algorithm.
2020-10-12 17:44:23 -07:00
Jonah Williams 5dfe7e6d51
[flutter_tools] attempt to stabilize hot restart benchmark the old fashioned way (#67971)
A change which sped up hot restart locally caused many of the devicelab measures to regress. I think this is because we do not measure when the isolate is actually "ready", so starting a reload or restart prematurely can cause time spent doing initialization to be registered as part of the reload operation.

A fix for this would be to have the framework include some sort of "initialization complete" event ... but it is not clear what the correct trigger would be. Perhaps after the first frame is successfully registered?

(9a3a0dc caused the benchmark regression - possibly since we spend less time syncing files now so we start the restart earlier)
2020-10-12 17:00:26 -07:00
Jonah Williams 18bb4d7254
Revert "[flutter_tools] reland: fold process resolution logic into the flutter tool (#67957)" (#67968)
This reverts commit bd8138797e.
2020-10-12 15:53:16 -07:00
Jonah Williams 52f8b89c0e
[flutter_tools] dont allow creating package name that is invalid (#67786)
According to https://dart.dev/tools/pub/pubspec#name , uppercase is not permitted for package names.
2020-10-12 15:38:23 -07:00
Jonah Williams bd8138797e
[flutter_tools] reland: fold process resolution logic into the flutter tool (#67957)
Reland of #67669

The flutter tool has a number of crashes on stable where an ArgumentError is thrown due to the process manager not being able to resolve an executable.

So that we can adjust/modify this logic, fold it into flutter and add some additional logging.
caches the resolved executable per target directory, to avoid repeated look ups.
Instead of throwing an argument error, attempts to run the executable as given if an exact path can't be found
Accept files or symlinks for the executable path.
user where/which to resolve path instead of package:process logic.
2020-10-12 15:37:02 -07:00
Jonah Williams 408cd71d82
[flutter_tools] check asset files while the tool waits for the frontend_server compile (#67826)
On every hot reload, the flutter tool must file stat each asset in the bundle. With a large number of assets or a slow file system, this can take 20 - 30 ms. Do this operation while the flutter tool is waiting for a response from the frontend_server.

No tests updated since this is only a timing update. Any difference in behavior will be shown on benchmarks
2020-10-12 14:06:40 -07:00
Jonah Williams 354e2a57b1
Revert "[flutter_tools] fold executable resolution into flutter (#67669)" (#67954)
This reverts commit 10c78c264a.
2020-10-12 13:15:39 -07:00
Jonah Williams 10c78c264a
[flutter_tools] fold executable resolution into flutter (#67669)
The flutter tool has a number of crashes on stable where an ArgumentError is thrown due to the process manager not being able to resolve an executable. Fold the resolution logic into the tool and use where/which instead of the package:process specific logic.
2020-10-12 12:51:37 -07:00
Jonah Williams ac614de7ac
[flutter_tools] validate that SkSL bundle path exists (#67883)
Fixes #61772

tool exit if there is no file at the path provided when building/running with sksl
2020-10-12 12:49:51 -07:00
Jonah Williams fd11d149f7
[flutter_tools] teach flutter drive to uninstall if install fails (#67936)
Work towards #39925

Currently flutter run will uninstall and reinstall if the initial install fails and the APK was previously installed. Allow drive to share this same logic by moving it into installApp and out of startApp.

This should reduce the occurrence of the error in the devicelab.
2020-10-12 12:49:36 -07:00
Jonah Williams b4e4e8d965
[flutter_tools] do not crash validator if intellij JAR file is missing (#67931)
This failure has been happening for a while but was covered by the overly broad catch. Removing that revealed that newer intellij versions have a different plugins file. The tool still can't find the file, but it won't crash now

Fixes #67918
2020-10-12 10:34:05 -07:00
Sam Rawlins 23c7ee9deb
Bump meta to 1.3.0-nullsafety.4 (#67744) 2020-10-12 09:50:30 -07:00
Jonah Williams 0afddf3578
[flutter_tools] use fixed entry for dill uploads (#67837)
For historical reasons, the flutter tool uploads dill files to paths based on the entrypoint URI. This isn't actually necessary, and the tool can use specific files : main.dart.incremental.dill for incremental dills, and main.dart.dill/main.dart.swap.dill for full dills. This allows hot restarting applications with an entrypoint outside of lib/ and simplifies the devFS code.

Fixes #63243
2020-10-12 09:47:41 -07:00
Jonah Williams 08576cb671
[flutter_tools] HACKTOBERFEST (#67882)
HACKTOBERFEST
2020-10-12 09:31:02 -07:00
Jonah Williams 1a9d635f64
[flutter_tools] remove --with-driver-test (#67783)
Remove flutter create --with-driver-test . Fixes #64095
2020-10-09 21:03:37 -07:00
Alexander Markov 1973cf2d6c
Remove uses of bytecode mode of Dart VM (#67755) 2020-10-09 16:33:06 -07:00
James D. Lin e4206ac5dd
[flutter tools] Add a DelegatingLogger class (#67581)
[flutter tools] Add a DelegatingLogger class

Move most of `DelegateLogger` `from test/src/testbed.dart` to
`lib/src/base/logger.dart` to better formalize the common practice of
chaining `Logger`s together.  I renamed the class since it isn't
itself the delegate and to better match the `Delegating...` classes
from `package:collection`.

Additionally, add a freestanding `asLogger<T>` function to "cast" a
`Logger` into a matching delegate if possible.  This will allow
`Logger` chains to be ordered a *bit* more freely (e.g.
`NotifyingLogger` and `AppRunLogger` will no longer required to be
at the end of the chain, an unwritten rule that has led to breakage in
google3).  Chain order still matters since lack of virtual dispatch
means that parent `Logger`s can never invoke child methods, however.

I made `asLogger<T>` a freestanding function because I didn't want to
make it part of the `Logger` interface (and I thought that making it
an extension method might be weird).

Bonus cleanup:
There no longer appears to be a way to construct an `AppRunLogger`
with a null parent, so remove all of code paths for that case and
make the `parent` construction parameter required.
2020-10-09 15:55:24 -07:00
Jonah Williams bdb830a833
[flutter_tools] pretty print hot reload rejection error (#66701)
If the vm of an attached device rejects a hot reload, pretty print the reason. Suggest a hot restart so that users are aware that they do not have to detach and rebuild. Also resets the last compilation time, so a subsequent restart would still apply the last change. Adds an integration test for the const field removal.

Fixes #64027
2020-10-09 15:44:52 -07:00
Jonah Williams 5fa801718f
[flutter_tools] remove train and inject-plugins command (#67766)
The train command does nothing and was originally added to provide a no-output default for generating app-jit snapshots. The inject-plugins command is only for a repo-only analysis check, which is not necessary since we regenerate during pub get.

#29805
2020-10-09 15:43:39 -07:00
Jonah Williams cba84d5127
[flutter_tools] remove globals from IntelliJ validator, refactor tests to remove dependency on JAR (#67240)
Move the intellij validator to its own file, and split off the tests. Remove globals from each, and remove dependency on a real jar/filesystem by creating a minimal version of the manifest xml and setting it up in the memory file system.

#47161
2020-10-09 13:05:42 -07:00
Jonah Williams 9a3a0dc18f
[flutter_tools] hot reload/restart update for asset manager change (#66742)
Do not upload all assets on initial devFS sync. This should increase the reliability of the initial connection, even in the face of flaky devfs behavior, in addition to a moderate perf improvement.

Updates fast-start to build assets as part of the initial bundle

Requires flutter/engine#21436
Requires flutter/engine#21586
Requires flutter/engine#21611
2020-10-09 12:25:15 -07:00
nturgut a755c03819
Add web e2e to the flutter/flutter repo (#67693)
* adding tests that uses integration_test (e2e) package to flutter

* change the package name for the import

* fix licenses. fix README commands. add links

* adding dependency change auto generated by the tool

* more analyzer error fixes
2020-10-09 12:24:36 -07:00
Jenn Magder 98aeef2d98
Build xcarchive command (#67598) 2020-10-08 19:51:35 -07:00
Jenn Magder f92ba2d2c5
Replace MockUsage with Usage.test in build tests (#67670) 2020-10-08 16:09:49 -07:00
Jonah Williams 973404a27f
[flutter_tools] support powershell style help request (#67493) 2020-10-08 14:06:58 -07:00
Jonah Williams ddab09f553
[flutter_tools] enable LocalDevFSWriter for desktop devices, iOS simulator (#66678)
* [flutter_tools] enable LocalDevFSWriter for desktop devices, iOS simulator

* Update device.dart

* Update desktop_device_test.dart

* fix analysis errors
2020-10-08 13:40:19 -07:00
Christopher Fujino ccdaa37043
Remove the .zip method from OSUtils, as it was not used (#67367)
We used to use zip to verify the integrity of downloaded zip archives, but we now use unzip. This removes the .zip method from OperatingSystemUtils.
2020-10-08 13:40:01 -07:00
Jonah Williams 30c0fc1bce
[flutter_tools] remove globals from compile and devices (#67485)
Remove global variables from compile.dart and devices.dart (except for dds which needs more changes).

#47161
2020-10-08 12:28:58 -07:00
Yegor 0b78110b26
Work around the glibc bug that causes rare Chrome crashes (#67466)
Work around the glibc bug that causes rare Chrome crashes
2020-10-07 19:29:47 -07:00
Dan Field 8d9e0d4b95
Respect --enable-software-rendering flag on iOS simulators (#67576) 2020-10-07 18:07:10 -07:00
Jonah Williams b3f9944f3c
[flutter_tools] remove deprecated flutter command (#67478) 2020-10-07 16:21:08 -07:00
Jonah Williams a4e0e2a8ee
Revert "[flutter_tools] remove all pub caching logic (#66776)" (#67572)
This reverts commit 76cbc462d2.
2020-10-07 15:30:46 -07:00
Jonah Williams 76cbc462d2
[flutter_tools] remove all pub caching logic (#66776)
There have been some more additional reports of a missing 'package:characters' import after upgrading flutter, as well as problems with detecting the correct language version. This has me concerned that our pub caching logic is incorrect. Instead of the tool attempting to guess when pub should be run, always delegate to pub.
2020-10-07 13:11:07 -07:00
Jenn Magder f8b1de3a63
Add publish-port flag to disable mDNS port discovery (#67452) 2020-10-07 08:52:05 -07:00
Jonah Williams e1b4142a74
[flutter_tools] remove stray print from engine locator (#67530)
Woops, this is breaking Dart's golem benchmarks
2020-10-07 08:51:20 -07:00
Jonah Williams 13bf341584
[flutter_tools] update build rules to depend on subset of package_config contents (#67165)
Split from #66776

Even if pub does not change the packge_config contents, it will still update a timestamp in one of the fields. This causes unnecessary rebuilds. To fix this, generate an additional file when running pub get that only contains the relevant fields and then update the KernelSnapshot rule to depend on it only.
2020-10-07 08:46:11 -07:00
Jonah Williams ef6c720d40
[flutter_test] handle breaking change to test main (#67425)
* [flutter_test] handle breaking change to test main . Fixes #67382
2020-10-06 16:52:23 -07:00
stuartmorgan be6a368801
Improve Windows symlink instructions (#67029)
When the developer doesn't have permission to create symlinks, we
display specific instructions, but they were only correct for recent
versions of Windows 10. This improves them by:
- Giving the correct instructions for older versions.
- For recent versions, adds a command that will deep-link into the
  settings application so that developers don't have to figure out
  where/how to enable developer mode.

Fixes https://github.com/flutter/flutter/issues/66973
2020-10-06 08:32:54 -07:00
Nate Bosch 8ee2b2f1d1
Condense package:test_core imports (#67357)
Use the new single `src/platform.dart` import to pick up what is needed
to implement a test platform from both `test_api` and `test_core`.
2020-10-06 08:26:31 -07:00
Alexandre Ardhuin f551178408
migrate material to nullsafety (#67166)
* migrate material to nullsafety

* address review comments

* address review comments

* fix build
2020-10-06 11:36:50 +02:00
Jonah Williams 734cc1a132
[flutter_tools] work around hostonly test (#67369)
Many of the host only devicelab tests were relying on doctor to download android dependencies.
2020-10-05 18:26:37 -07:00
Jonah Williams 1271447bbe
[flutter_tools] remove globals from FlutterValidator, add documentation and move tests to new file (#67234)
Remove globals from the flutter validator class, and refactor the tests into a separate file. Applies some other cleanup like adding doc comments, and making the doctor validator work like it is documented to work - removing the gen_snapshot check if the artifact is not downloaded instead of downloading all android artifacts.

#47161
2020-10-05 17:58:56 -07:00
Jonah Williams 2474b07768
[flutter_tools] add more docs to cocoapods, move to globals (#67237)
Add some placeholder docs to the Cocoapods validator and Cocoapods class. Add the injected validator to globals. #47161
2020-10-05 17:57:48 -07:00
Jonah Williams c8466d0430
[flutter_tools] handle case where file is deleted by other program or running on read only volume (#66708)
* [flutter_tools] handle case where file is deleted by other program

* Add test cases

* Update file_system.dart

* Update file_system_test.dart

* fix import

* make a static on ErrorHandligFS

* add support for no exit on failure

* address comments

* update doc comment to file or directory
2020-10-05 17:00:07 -07:00
Jonah Williams 7f2ca5e532
[flutter_tools] refactor engine locator to its own class (#67274)
Make the logic for locating a local engine path part of its own class, add documentation, and update tests to cover engine source path locating too.

#47161
2020-10-05 16:25:47 -07:00
Jonah Williams 6180a4c179
[flutter_tools] fix documentation, globals, and todos in the android codebase (#66980)
Cleans up some undocumented classes and re-organizes the AndroidDevices class to avoid the need for the static testing only member. Adds a script for tracking globals.
2020-10-05 15:47:57 -07:00
Jonah Williams 186765b3a7
[flutter_tools] cleanups to plugin test cases (#67242)
Removes usage of global variables, expands documentation, and fixes some formatting inconsistencies. Increased test coverage for android plugin to prove it can determine the embedding version.
2020-10-05 14:45:39 -07:00
Jonah Williams aa90dbe7f4
[flutter_tools] disable source maps by default for release builds, enable for run and with command line arg (#67331)
Disables source map production by default for build web. For web builds performed as a part of flutter run --release, enable the source maps, or allow force enabling with --source-maps command line flag.

fixes #67328
2020-10-05 13:24:51 -07:00
Jenn Magder 6e5f9ed94d
Replace MockProcessManager with FakeProcessManager (#67019) 2020-10-05 12:21:43 -07:00
Dan Field ece2f98eb0
Remove goldens request timeout (#67316) 2020-10-05 10:15:09 -07:00
Jonah Williams 3a51bcb5c0
[flutter_tools] delete code related to reload method (#67279)
This functionality ultimately became the single widget reload optimization, which did not require a separate service protocol.
2020-10-05 09:57:10 -07:00
Jonah Williams 21bb29cc68
[flutter_tools] support all engine debugging options with FLUTTER_ENGINE_SWITCH environment variables (#67150)
Allow providing all debugging options to the desktop engine via the FLUTTER_ENGINE_SWITCH_ environment variables.

Fixes #66532
Fixes #46005
Fixes #58882

The underling engine changes have already landed for Windows, macOS, but linux is still in progress
2020-10-05 09:56:48 -07:00
Jonah Williams 4ce2a7aa6d
[flutter_tools] do not use IOSink for writing cache responses (#67231)
Any File-derived IOSink may throw un-handleable async exceptions into the zone, see dart-lang/sdk#43663 . Instead, just write to a file with an append mode.
2020-10-05 09:05:41 -07:00
Danny Tuppeny fdd1bf2944
Handle missing Android SDKs in getEmulators() (#67295) 2020-10-05 08:57:04 -07:00
Jesse 60d7bb2588
Use XDG_CONFIG_HOME dir by default for config files (#66645)
This PR changes the Config class in flutter_tools to use the XDG Base directory specification instead of putting files directly in the user's home directory. If those files are already present in the home directory, they are used instead.
2020-10-03 08:40:09 -07:00
Jonah Williams ddb8177018
[flutter_tools] remove globals from desktop configuration (#67146)
Refactors the desktop devices and workflow to remove unnecessary usage of global variables. This should make it easier to test and continue enhancing the desktop functionality of the tooling

#47161
2020-10-02 21:52:53 -07:00
Jonah Williams ddb01a0c81
[null-safety] add integration tests for sound null safety modes, add support for sound null safety in dart2js (#67171)
Add integration tests to verify that ddc and dart2js can be built and run in sound mode. Updates dart2js compilation to insert a language version comment into the generated entrypoint if necessary.

dart-lang/sdk#42253
2020-10-02 21:52:38 -07:00
Jonah Williams 1bea512a83
[flutter_tools] flutter logs no longer requires supported device (#66696)
Flutter logs should not attempt to filter the device list based on the current project, because it does not require a current project. Also fix disabled polling test

Fixes #47996
Fixes #63550
2020-10-02 21:12:50 -07:00
Jonah Williams f6cbf488e1
[null-safety] pass experiments to builders (#67152)
Force opt-in flutter test platform to null safety for repo testing
2020-10-02 16:38:50 -07:00
Mouad Debbar b42e34690a
[web] Update index.html template to support new path strategy (#67081) 2020-10-02 15:12:04 -07:00
Mouad Debbar 5d6321b509
[web] Respond with 404 to non-found asset or package files (#67088) 2020-10-02 11:02:03 -07:00
Jonah Williams 385ae40218
allow web shard to compile null-safe tests (#67106) 2020-10-02 10:59:00 -07:00
includecmath f1013e6873
[flutter_tools] According to AnalysisSeverity return exit code detailed proposal (#61589)
No matter what level(error, warning, info) issues flutter analyze always return fatal exit code(1). CI/CD environment receive 1(!0). This may leads to e.g. Jenkins Build step 'Execute shell' marked build as failure.
I propose according to AnalysisSeverity level return fatal(1) or success(0) exit code.
2020-10-01 18:50:33 -07:00
Jacob MacDonald b95c3d7d56
update stack_trace dep (and others) (#67057) 2020-10-01 09:54:07 -07:00
Jenn Magder 36fca52c0d
Replace MockArtifacts with Artifacts.test() (#67012) 2020-09-30 16:25:29 -07:00
stuartmorgan b92bb62d4d
Fix Windows and Linux plugin template filenames (#66997) 2020-09-30 16:07:03 -07:00
Jonah Williams b6768ec7a6
[flutter_tools] dont let crash reporter crash tool (#66755)
package:http can throw a ClientException, which the crash reporter must catch or the tool will crash in the crash reporter. 3/4 crash on dev.
2020-09-30 15:26:25 -07:00
Jonah Williams 0f90747bb3
[flutter_tool] enable single widget reload optimization by default on dev (#66995)
Continued gradual rollout - dev is not that much riskier than master but will give much more data
2020-09-30 15:10:51 -07:00
Jenn Magder becaf4913f
Replace MockCache with Cache.test() (#66946) 2020-09-30 14:53:57 -07:00
Jonah Williams fe22d196fc
[flutter_tools] prevent running analyze-size with split-debug-info (#66983)
Running a build command with split debug info and analyze size causes a crash in the snapshot analysis library. Disable the combination of these two flags.

Fixes #66962
2020-09-30 11:15:49 -07:00
Helin Shiah 9ca15d0118
Set DDS port to requested observatory port for test (#66607)
* Set DDS port to requested observatory port for test

* Add test for DDS and observatory ports

* Use FakePlatform instead of mock, fix spacing

* Use FakeProcessManager instead of mock

* Fix analyze issue

* Make completer private and add fn for future
2020-09-30 10:14:13 -07:00
Jonah Williams f8750b16bb
[flutter_tools] do not error doctor on missing vs code extension (#66780)
In cases where the VSCode plugins are not located, display links to where they can be downloaded but do not surface an error.
2020-09-30 08:41:31 -07:00
Jonah Williams e819f292b3
[flutter_tools] do not require a dependency on devtools server (#66842)
Re-arrange the implementation of the devtools launcher so that google3 is not required to depend on any devtools packages. Also renames the build_runner folders to isolated to better clarify their intention.
2020-09-29 18:15:56 -07:00
Jenn Magder e8fbb43aac
Replace MockFile with memory file system files (#66941) 2020-09-29 17:50:33 -07:00
Jonah Williams 9bc533c9e5
[flutter_tools] do not error flutter doctor on missing AS/intellij plugins (#66782)
In cases where the Intellij/AS plugins are not located, display links to where they can be downloaded but do not surface an error. This should generally reduce confusion about whether the plugins are required for every installed IDE. For example, frequently users may only install AS so that they can install the Android SDK - or they may have multiple copies of Intellij installed.

For example: #66762
2020-09-29 16:51:28 -07:00
Jonah Williams 0e9c6a3d5f
[flutter_tools] do not crash if chrome preference save fails (#66705)
Crash reporting shows at least one occurrence of this due to a windows file lock. That could happen if there is another running chrome instance, or perhaps a virus scanner is running. Print out the error and do not crash.
2020-09-29 13:00:11 -07:00
Marcus Tomlinson 5f76bfb4af
Add the ability to inject a bootstrap script (#66897) 2020-09-29 19:24:21 +01:00
Ben Konyi 65a81c7cd3
Roll package:dds to 1.4.0 and update error handling (#66836) 2020-09-29 10:28:17 -07:00
Jonah Williams 6f20c8a83f
[flutter_tools] handle missing zip/unzip argument errors (#66685)
it is possible for users that download the prebuilt SDKs to run the tool without unzip installed. Rather than crashing with an unclear argument error, exit the tool with a message on how to install that mirrors the message in the update_dart_sdk.sh script.

Also applied to zip for completeness
2020-09-29 07:58:09 -07:00
Jonah Williams 21caa8db33
Update flutter_tools README.md to document need for FLUTTER_ROOT (#66854) 2020-09-28 14:36:09 -07:00
Jonah Williams 549de844ed
[flutter_tools] add a mechanism to turn off immediate tool exit (#66787)
Instead of always exiting the tool, provide a mechanism to turn off this behavior for non-critical functionality like configuration and analytics settings.

Fixes #66786 Fixes #4674
2020-09-28 13:04:38 -07:00
Jenn Magder 65159afb55
Force plugins to inherit minimum iOS version from Flutter app (#66590) 2020-09-28 10:14:47 -07:00
Ian Hickson d95bff1ed8
Minor tool text typo (#66801) 2020-09-28 09:27:04 -07:00
Tim Sneath b8397f69d3
Improve consistency of top-level help text (#66748) 2020-09-27 15:12:03 -07:00
Jonah Williams ec40df9576
[flutter_tools] dont mention git clone of flutter in run message (#66691)
This message is displayed if we do not find a pubspec.yaml

99% of the time this additional advice is going to have nothing to do with the actual error. Just remove it because it will cause more confusion than it could clear up
2020-09-25 21:27:22 -07:00
Jonah Williams 19fbe98df3
[flutter_tools] pass existsSync through error handling io (#66704)
Crash reporting shows at least one instance of EACCES during an existsSync cache call. Add this to the list of error handling io methods. Did not add the async exists method since we lint against its usage.
2020-09-25 20:17:39 -07:00
knaeckeKami 8e9e13449b
Teach the flutter tool how to find android output files if the flavor contains uppercase letters (#66687)
This changes the name of the generated output files on android in case a flavor with uppercase letters is used.
Previously, the lowercased flavor name would be used for the apk/aab file. Now, the flavor name is used as-is.
2020-09-25 15:54:55 -07:00
Mouad Debbar 31254fbe03
[web] Change the web server to support path url strategy (#66606) 2020-09-25 15:42:03 -07:00
Nebi Sarigul eb54388934
Update .gitignore.tmpl (#66382) 2020-09-25 15:37:03 -07:00
Jonah Williams 99d0954857
[flutter_tools] ensure ErrorHandlingFileSystem wraps current directory (#66680)
The lack of current directory wrapping was letting some of the already handled errors through

Fixes #66675
2020-09-25 14:29:22 -07:00
Jenn Magder 934e05f86d
Remove Try accepting the local network permissions popup warning (#66621) 2020-09-25 11:05:47 -07:00
gaaclarke 76ad864727
Added timeout for closing devfs sync http connections. (#66152) 2020-09-25 10:52:33 -07:00
Jonah Williams 90bc7c64dd
[flutter_tools] fix calling debugToggleBrightness on release mode (#66401)
ensure that the terminal handler checks if the service protocol is enabled before calling debug toggle brightness. Also removes globals from TerminalHander and test cases.

Fixes #65477
2020-09-24 18:56:07 -07:00
includecmath 71c42c9c54
[flutter_tools] Add channel order aware version_test (#62417) 2020-09-24 13:07:03 -07:00
Jonah Williams b9274c7c60
[flutter_tools] bypass pubspec yaml content check when running pubdependencies (#66559)
Otherwise the heuristics we have may decide to skip running pub. We should consider reducing the number of dimensions of caching here to a single check optimized for the run/test case.
2020-09-24 12:51:18 -07:00
Jonah Williams 90d83e37a6
[flutter_tools] register service worker after first frame event (#66082)
Registering the service worker immediately after the documented has loaded may cause SW initialization to compete with framework initialization. It was recommended to us that we defer the service worker setup until after the framework is done with setup, which should be sometime after the first frame.

To implement this, I augmented the binding setup to dispatch an event on the document after the binding has initialized. I don't see any obvious risks with this setup.

Fixes #66066
2020-09-23 18:58:05 -07:00
Jonah Williams 6642d8f16a
[flutter_tools] enable single widget reload optimization by default on master (#66507)
This should be a mostly non breaking change for hot reload workflows that improves performance, but if you see anything odd with hot reload behavior on master please file a bug. This feature can also be disabled without any changes to the SDK with flutter config --no-single-widget-reload-optimization
2020-09-23 17:26:58 -07:00
Jonah Williams faa4b6635a
[flutter_tools] try deleting the web cache directory before copying new web sdk (#66461)
Delete the destination directory for the web sdk before copying the new contents. This might fix an error where the OS refuses to overwrite the files on dev
2020-09-23 16:45:20 -07:00
Jonah Williams 707aa49e42
[flutter_tools] flush UI thread tasks before finishing hot restart (#66417)
Improve our ability to measure the performance of hot restart. Also flush all UI thread tasks before calling the hot restart "complete" in benchmark mode.

If this is successful at stabilizing the benchmarks, this should be enabled for "normal" hot restart so that we can accurately track execution time.
2020-09-23 13:39:52 -07:00
Jenn Magder f654346777
Check git commands in Flutter version check test (#66406) 2020-09-23 13:27:24 -07:00
Greg Spencer bbd7b97664
Change the default visual density to be adaptive based on platform. (#66370)
Based on feedback from various desktop developers, and to be consistent between the defaults and the sample code, this PR switches the default for visual density in desktop themes to be compact instead of standard.

It also removes the same setting from the sample code generated by "flutter create" because it is no longer needed now that it is the default.
2020-09-23 11:14:58 -07:00
Jacob MacDonald 9cee75ba61
update to the latest null safe packages (#66384)
Updates all null safe dependencies to versions that allow 2.10 stable and 2.11 dev releases.

Also updates flutter_goldens and flutter_goldens_client to allow 2.11 dev.
2020-09-23 11:03:29 -07:00
Jonah Williams 1d4e7cd52d
[flutter_tools] do not add events to closed sink in throttle transform (#66468)
The throttle duration could delay past the point where the destination sink was closed. Check if it is closed before adding an event. Fixes a crash on dev: StateError: Bad State: Stream is already closed.
2020-09-23 10:40:39 -07:00
Emmanuel Garcia fc1e764264
Expose enable-experiment in Flutter drive (#66311) 2020-09-23 10:38:02 -07:00
Jonah Williams 51ededb92f
[flutter_tools] reland: map file URIs to a multiroot scheme (#66405)
If a file scheme and one or more roots is provided, fall back to this mapping before the direct file path if the file path cannot be turned into a package URI.

Use URI representation so that the transformation is resilient to the org-dartlang-app scheme used by the web builds.

Fixes #66095
Fixes #66404
2020-09-23 07:03:59 -07:00
Jenn Magder 78e54dd46b
Revert "[flutter_tools] map file Uri to multi-root scheme if provided (#66151)" (#66403)
This reverts commit af6ba86728.
2020-09-22 17:50:27 -07:00
Jenn Magder d5b715d7cb
Stream logging from attached debugger on iOS 13+ (#66399) 2020-09-22 17:16:45 -07:00
Jenn Magder 658e6c8a8d
Listen to Debug VM stream to get Stdout logs from VMService (#66310) 2020-09-22 17:12:02 -07:00
Jonah Williams 943b41bd61
[flutter_tools] allow device classes to provide platform-specific interface for devFS Sync (#66266) 2020-09-22 16:57:04 -07:00
Jonah Williams af6ba86728
[flutter_tools] map file Uri to multi-root scheme if provided (#66151)
If a file scheme and one or more roots is provided, fall back to this mapping before the direct file path if the file path cannot be turned into a package URI.

Fixes #66095
2020-09-22 16:51:18 -07:00
Ben Konyi a3b3d53d62
Revert "Revert "Ensure VmService instance is disposed after failed direct connection attempt (#66123)" (#66164)" (#66377)
This reverts commit 3e6863ab2b.
2020-09-22 16:29:13 -07:00
Jenn Magder 4881b4b07c
Revert "Stream logging from attached debugger on iOS (#66092) (#66390)" (#66397)
This reverts commit 2be4570d3a.
2020-09-22 15:15:56 -07:00
Jenn Magder 2be4570d3a
Stream logging from attached debugger on iOS (#66092) (#66390) 2020-09-22 14:59:14 -07:00
Jonah Williams 76698a5026
[flutter_tools] dont crash if attach is given a bad debug uri (#66358) 2020-09-22 12:03:21 -07:00
Jenn Magder 8d2e257633
Revert "Stream logging from attached debugger on iOS (#66092)" (#66368)
This reverts commit 5c8580360a.
2020-09-22 11:30:50 -07:00
Dan Field 4299dd7843
Revert "Revert "Stream logging from attached debugger on iOS (#66092)" (#66359)" (#66360)
This reverts commit 53fee1be38.
2020-09-22 09:23:57 -07:00
Dan Field 53fee1be38
Revert "Stream logging from attached debugger on iOS (#66092)" (#66359)
This reverts commit 5c8580360a.
2020-09-22 09:22:55 -07:00
Jonah Williams 511367aa5a
[flutter_tools] remove k toggle for canvaskit from web runner (#66273)
The k toggle allows switching between canvaskit and html backend at runtime. unfortunately this causes hot restart to break, since the dart_sdk modules stores state at runtime. The recommendation will be to use cavaskit via dart-defines.
2020-09-21 15:33:32 -07:00
Jonah Williams 6809542008
[flutter_tools] declare non-transitive deps correctly (#66269) 2020-09-21 15:22:06 -07:00
Yegor 905feb7771
roll source_span 1.8.0-nullsafety.2 (#66290) 2020-09-21 15:02:07 -07:00
Jonah Williams 2c6f862bf8
[flutter_tools] add EPERM to set of immediate exit errors (#66159) 2020-09-21 11:32:07 -07:00
Jonah Williams a029e172fe
[flutter_tools] fix bug where last build id parent folder is missing (#66156) 2020-09-21 11:17:13 -07:00
Jonah Williams 689ca09cd0
[versions] update to latest source span and roll engine to 4b8477d11573d233e6791204191c0090f733b05d (#66136) 2020-09-19 11:22:07 -07:00
Jonah Williams a19f5baccc
[flutter_tools] connect widget cache from frontend_server (#65951) 2020-09-19 11:02:04 -07:00
Zachary Anderson 3e6863ab2b
Revert "Ensure VmService instance is disposed after failed direct connection attempt (#66123)" (#66164)
This reverts commit 409e994cd0.

Co-authored-by: Jenn Magder <magder@google.com>
2020-09-18 21:05:27 -07:00
Jenn Magder 5c8580360a
Stream logging from attached debugger on iOS (#66092) 2020-09-18 15:26:28 -07:00
stuartmorgan c11440ae92
Remove the Windows 'flutter create' warning (#66113) 2020-09-18 14:32:10 -07:00
Ben Konyi 409e994cd0
Ensure VmService instance is disposed after failed direct connection attempt (#66123)
_attemptServiceConnection in FallbackDiscovery would fail if the root
library URI was not a package URI even if the VM service connection
attempt was successful. This resulted in a VM service connection being
left alive, causing DDS to fail its connection to the VM service.

Updated _attemptServiceConnection to ensure the VM service instance is
disposed after a non-connection related failure and to allow for root
library URIs with a file scheme.
2020-09-18 14:20:35 -07:00
Jonah Williams 84aae22c3e
[flutter_tools] optimize fetch requests and remove main.dart.js bypass (#66069)
The main.dart.js bypass is not needed now that we have skipWaiting. Additionally optimize the fetch handler so that resources not in the cache skip the service worker altogether.

Fixes #66068
2020-09-17 17:05:46 -07:00
Yegor fde120df6d
Hide flutter test --platform (#65984) 2020-09-17 16:02:06 -07:00
Daniel Edrisian 3a5e45404d
Updated androidMissingSdkInstructions error message (#65964) 2020-09-17 15:57:06 -07:00
younghwan 634e461c4d
Apply darkmode style (#65182) 2020-09-17 15:32:05 -07:00
Jonah Williams bc11c2a8c4
[flutter_tools] update windows config feature (#65867) 2020-09-17 15:24:52 -07:00
stuartmorgan 50fd10fc6f
Consider the Windows app template stable (#66022)
Removes the template version from the Windows template; the API and
tooling boundary will now be considered stable, so there will no longer
be frequent breaking changes.

Also updates the link for adding desktop support to a project for all
three platforms to reflect the current location.

Fixes https://github.com/flutter/flutter/issues/52748
2020-09-17 15:24:28 -07:00
stuartmorgan 8162bbd8e8
Update Windows system font change handling (#66021)
The engine now has an explicit API for system font changes, rather than
expecting the WM_FONTCHANGE message to be forwarded to the Flutter view.
2020-09-17 15:23:56 -07:00
stuartmorgan eaf3f8b4f7
Add VERSIONINFO to the Windows template (#66025)
Adds a VERSIONINFO to Runner.rc in the Windows app template, populated
from the project creation metadata.

Currently the version itself is hard-coded, but it is future-proofed to
allow plumbing the actual version through at build time via preprocessor
defines.
2020-09-17 15:23:38 -07:00
Jonah Williams 3e838da96a
[flutter_tools] use flutter tool handler for dwds resources and precache tool pub dependencies (#65814)
If the tool is downloaded from a precompiled snapshot, or if the backing source files in the pub cache are deleted, the dwds debugging functionality will break as the client.js file cannot be located. Instead use the PackageConfig to verify that package location, downloading if it is missing.

Override the dwds middleware to avoid Isolate.resolvePackageUri

Fixes #53644
Fixes #65475
2020-09-17 15:22:06 -07:00
Herbert Poul af2143412f
Remove FlutterApplication from app templates. (#64742) 2020-09-17 15:17:11 -07:00
Michael Arndt fbc34def01
Fixed typo (subetting -> subsetting) (#62502) 2020-09-17 15:17:08 -07:00
Jenn Magder 4fee00798a
Inform user how to fix permissions when the observatory URL isn't found on iOS 14 (#65977) 2020-09-17 15:16:55 -07:00
Ben Konyi fb08acf10c
Roll packages to fix #66038 (#66052)
PR #65873 enabled DDS for non-web Flutter applications. This change
surfaced a bug where DDS would not send ServiceRegistered events to VM
service clients when they subscribed to the Service stream. This would
cause tools and tests that rely on these events (e.g., hot reload in
VSCode) to fail.

Fixes #66038.
2020-09-17 12:28:49 -07:00
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
Jonah Williams b02cb6e4c9
[flutter_tools] make local engine integration testing easier (#65802) 2020-09-15 13:32:02 -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
Jenn Magder 7e27b140f0
Avoid thinning frameworks in iOS extensions (#65198) 2020-09-15 11:10:25 -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
Jonah Williams b88f308af7
[flutter_tools] port deprecated settings test to flutter integration shard (#65806)
Port the deprecated settings devicelab test to tool integration shard. Tests that apps can be built using the deprecated android/settings.gradle file.

Part of #65790
2020-09-15 10:55:07 -07:00
stuartmorgan fa12f443df
Update Windows app template (#65696) 2020-09-14 18:07:04 -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