Commit graph

5100 commits

Author SHA1 Message Date
Pierre-Louis 598627cd3b
Fix typo (#70834) 2020-11-19 16:43:09 -08:00
Yegor 535a4ac3ab
Clean-up docs for the --web-renderer option (#70880) 2020-11-19 16:41:09 -08:00
Jonah Williams 7086a2f43b
Revert "[flutter_tools] wire up alternative invalidation strategy to features (#70865)" (#70884)
This reverts commit ef4741540b.
2020-11-19 14:01:39 -08:00
Jenn Magder 37f4f1f281
Detect ARM ffi CocoaPods error, suggest gem install (#70801) 2020-11-19 13:17:57 -08:00
Jonah Williams ef4741540b
[flutter_tools] wire up alternative invalidation strategy to features (#70865) 2020-11-19 13:13:51 -08:00
Jonah Williams 4832e64cad
[flutter_tools] remove globals from flutter web platform (#70863) 2020-11-19 13:06:30 -08:00
Jonah Williams c6290500f8
[flutter_tools] update dependencies (#70797) 2020-11-18 17:29:28 -08:00
Jonah Williams f8940709b2
[flutter_tools] refactor shared memory filesystem logic (#70795) 2020-11-18 17:29:13 -08:00
Jonah Williams 42c9c22553
Revert "Stop extra framework copy during build ios-framework (#70790)" (#70802)
This reverts commit a9a35d10a4.
2020-11-18 17:05:33 -08:00
Jenn Magder a9a35d10a4
Stop extra framework copy during build ios-framework (#70790) 2020-11-18 15:00:28 -08:00
Jonah Williams cfb63356c3
[flutter_tools] use frontend_server for web test compilation (#70714) 2020-11-18 14:55:26 -08:00
Jonah Williams f4e79e6828
[flutter_tools] add support for dart defines to flutter test (#70791) 2020-11-18 14:52:49 -08:00
Jenn Magder e26c7f98ff
Force regeneration of old Podfile (#70735) 2020-11-18 13:33:04 -08:00
Dan Field be2e7bb1c0
Revert "Revert "Allow any iOS app to be added to an existing host app (#70647)" (#70739)" (#70740)
This reverts commit aab9a76ee4.
2020-11-17 22:19:50 -08:00
Dan Field aab9a76ee4
Revert "Allow any iOS app to be added to an existing host app (#70647)" (#70739)
This reverts commit abdd65fc29.
2020-11-17 21:40:28 -08:00
Jenn Magder abdd65fc29
Allow any iOS app to be added to an existing host app (#70647) 2020-11-17 18:53:03 -08:00
Shi-Hao Hong 94ca7b4ad2
[gen-l10n] NNBD generated code (#70415)
* NNBD gen-l10n generated code
2020-11-18 10:14:38 +08:00
Ben Konyi 4cbafda853
Roll package:dds to 1.5.1 and add isCompleted guards around completers in base/dds.dart (#70712) 2020-11-17 16:03:18 -08:00
Ben Konyi f6bedddd9f
Support legacy behavior for --host-vmservice-port and --observatory-port with DDS (#70336)
Implements the following:
  - If both --host-vmservice-port and --dds-port are specified, use the current behavior
  - If only --host-vmservice-port is specified and dds is enabled, use that for the dds port
  - If only --dds-port is specified, use that for the dds port

Fixes https://github.com/flutter/flutter/issues/70332
2020-11-17 16:03:02 -08:00
Jonah Williams fa41afa82e
[flutter_tools] reduce build bundle API (#70514) 2020-11-17 11:55:20 -08:00
Jonah Williams 8d15fa3936
[flutter_tools] remove unused/deprecated asset flags (#70509) 2020-11-17 11:02:14 -08:00
Jenn Magder 2529e358b6
Move Flutter.framework to build directory instead of ios/Flutter (#70224) 2020-11-17 10:09:29 -08:00
Jonah Williams 9618788e28
[flutter_tools] remove globals from features (#70515) 2020-11-16 15:00:37 -08:00
Jenn Magder 148ae7bf71
Always build x86 mac apps (#70649) 2020-11-16 14:53:04 -08:00
Marcus Tomlinson 343577afb6
Add liblzma as an explicit dependancy on Linux (#70617) 2020-11-16 14:48:02 -08:00
Anna Gringauze f9df1935fe
[flutter_tools] Add bot configuration to run web_tool_tests for linux, mac, and windows (#70412)
* Move web integration tool tests to web.shard

Web integration tool tests depend on DDC changes in SDK. This change
moves them to a separate shard and subshard so CI bot configurations
can run them separately.

In particular, with will allow running those tests on dart CI flutter
HHH web bot instead of a non-web one, allowing early detection and easy
classification of issues caused by SDK changes as VM- or Web related.

* Enabled verbose mode for flaky web_tool_tests

* fixed local engine crash with --enable-asserts

* Disable failing tests, fix local engine with asserts

* Removed mac web_tool_tests bot

* Addressed CR comments

* Add disabled mac web_tool_tests and disable win web_tool_tests
2020-11-16 11:50:57 -08:00
Jonah Williams 6e84a14294
Revert "Simplify the flutter_web_plugins plugin registration API. (#70337)" (#70505)
This reverts commit 8749d95521.
2020-11-13 16:04:53 -08:00
Ian Hickson 8749d95521
Simplify the flutter_web_plugins plugin registration API. (#70337)
In principle this is backwards compatible; I just merged all the classes into one and deprecated everything that became redundant as a result.
2020-11-13 14:05:34 -08:00
Jonah Williams 8436c6ab7e
remove testUsingContext (#70482) 2020-11-13 13:23:03 -08:00
Jonah Williams f98c468317
[flutter_tools] remove unused JSON schema (#70480) 2020-11-13 13:02:40 -08:00
Jonah Williams a86dab0c40
[flutter_tools] remove automatic doctor from flutter create (#70475) 2020-11-13 11:44:10 -08:00
Jonah Williams 0a73ecf6df
[flutter_tools] use initially parsed package config for language version, sound mode determination (#70323) 2020-11-13 09:41:11 -08:00
Jonah Williams 0b88269807
[flutter_tools] remove branch migration and standardize constructor style for version interface (#70058) 2020-11-12 15:29:03 -08:00
Jenn Magder d11859fee7
Add -miphoneos-version-min=8.0 to App framework stub (#70405) 2020-11-12 15:14:53 -08:00
Jonah Williams 5fedad9173
[flutter_tools] allow using flutter test for testing the tool too (#69911) 2020-11-12 13:52:09 -08:00
Jonah Williams 22ec357bc4
[flutter_tools] make getBuildInfo async (#70320) 2020-11-11 15:33:23 -08:00
Jonah Williams 0f80116a63
[flutter_tools] improve hash performance in build_system (#70065) 2020-11-11 15:31:07 -08:00
Jonah Williams a40ee8a3fb
[flutter_tools] migrate .packages to package_config, partial (#70200) 2020-11-11 13:50:41 -08:00
Jonah Williams fb28ee2860
[flutter_tools] reland: cache pub invocations (#70180)
Disabled caching of pub invocations on flutter drive.
2020-11-10 13:56:36 -08:00
Jonah Williams 0bbd9020ed
[flutter_tools] remove experiment tracking analytics for null safety (#70183) 2020-11-10 12:49:50 -08:00
Jonah Williams 39bc68b6a2
[flutter_tools] dont use autodetect enum for web (#70189) 2020-11-10 12:49:38 -08:00
Jonah Williams 84a8bd3f5a
Revert "[flutter_tools] always use dart to run test script. (#70146)" (#70175)
This reverts commit a90880a8c3.
2020-11-10 05:21:14 -08:00
Jonah Williams a90880a8c3
[flutter_tools] always use dart to run test script. (#70146) 2020-11-10 05:02:56 -08:00
Jonah Williams dbcd7868a4
[flutter_tools] remove most globals from asset system and remove Cache manipulation in unit tests (#70011) 2020-11-09 18:01:04 -08:00
Jonah Williams 1c4b50ecf1
Revert "[flutter_tools] restore pub caching functionality (#70133)" (#70144)
This reverts commit ff953e4f83.
2020-11-09 16:38:07 -08:00
Jonah Williams 3fb389c75a
[null-safety] implement null-safe autodetection for the web (#70126)
Fixes #69416
Fixes #70121
2020-11-09 16:13:38 -08:00
Jonah Williams ff953e4f83
[flutter_tools] restore pub caching functionality (#70133)
Necessary to work around #70013 (this looks like it will be fixed, but should protect us in the future)

Restores some notion of skipping pub, with differences from the prior implementation:

Off by default, and only used by the flutter command automatic pub get
A single check parameter. Uses the framework version cached per-project instead of a timestamp of the tool, to avoid cases where downloading a prebuilt framework would cause this check to no longer work.
2020-11-09 16:11:55 -08:00
Greg Spencer bbc0161669
Remove references to Window, and switch usages to PlatformDispatcher or SingletonFlutterWindow (#69617)
* Remove references to dart:ui.Window, and point usages to PlatformDispatcher or SingletonFlutterWindow, as appropriate

* remove new test platform dispatchers

* Amend documentation
2020-11-09 15:26:29 -08:00
Jonah Williams 8c02c300d9
[flutter_tools] always run pub with prebuilt applicaitons on drive (#70136) 2020-11-09 14:55:04 -08:00
Yegor 879466eac2
default to unsound nullability for web (#70120) 2020-11-09 13:49:02 -08:00
Jonah Williams f1cdf2e6f3
Revert "[flutter_tools] restore pub caching functionality on run/test (#70056)" (#70132)
This reverts commit 6e5845f025.
2020-11-09 13:31:01 -08:00
Jonah Williams 6e5845f025
[flutter_tools] restore pub caching functionality on run/test (#70056) 2020-11-09 12:52:22 -08:00
Emmanuel Garcia 21e802746b
Migrate Flutter Gallery test to null safety (#70116) 2020-11-09 12:29:14 -08:00
Jonah Williams 4c511fbde2
[flutter_tools] remove workaround for caching sound dill (#70014) 2020-11-09 11:53:56 -08:00
Michael Thomsen 168ad5dc4d
Roll engine and fix pubspecs that do not have a Dart SDK constraint (#70078) 2020-11-09 19:02:10 +01:00
Michael Thomsen e4d94f7ccd
Revert "Migrate Flutter gallery test to null safety (#69048)" (#70023)
This reverts commit 7ba775a994.
2020-11-07 12:15:22 +01:00
Emmanuel Garcia 7ba775a994
Migrate Flutter gallery test to null safety (#69048) 2020-11-06 20:38:12 -08:00
Jonah Williams 52d49fb358
[flutter_tools] remove material design schema, use dart code (#69987)
Instead of loading the use-material-design asset data from a yaml file in the repo, leave it in dart code and simplify. Remove some of the globals, but not enough to update to testWithoutContext
2020-11-06 19:55:55 -08:00
George Wright 2b512781a0
Add a --dart-entrypoint-args flag to flutter run to pass through Dart entrypoint arguments on Flutter Desktop (#69607) 2020-11-06 15:34:02 -08:00
Jonah Williams 2fb53d83f2
[flutter_tools] remove all globals from cache and cache_test (#69505) 2020-11-06 15:26:45 -08:00
Jonah Williams 1f210275aa
[flutter_tools] wrap http send in async guard (#69972) 2020-11-06 11:00:20 -08:00
Mokusesei 6269abb75b
Reland: fix android studio 4.1 plugin path for mac (#69954) 2020-11-06 10:57:04 -08:00
Devon Carew 5ba2d79ad2
remove the use of the analysis server --enable-experiments flag from flutter analyze (#69966) 2020-11-06 10:56:34 -08:00
Jonah Williams e18533e7ab
[flutter_tools] remove globals from android_workflow (#69548) 2020-11-06 10:55:52 -08:00
Jonah Williams ef288c1720
[flutter_tools] work around bug in plugins CI (#69971) 2020-11-06 10:55:40 -08:00
Gary Roumanis 16daed86c3
Persist Chrome Default Directory (#69921) 2020-11-06 10:54:04 -08:00
Dan Field 76784651d4
Move package:integration_test to flutter/flutter (#69622) 2020-11-05 17:28:47 -08:00
Shi-Hao Hong a1a096e35a
[gen-l10n] Fix untranslated messages (#68553) 2020-11-05 16:24:02 -08:00
Jonah Williams dd8820bcc1
[flutter_tool] initialize flutter root in executable (#69549)
initialize the flutter root as early as possible. This allows all interfaces to be normally injected into commands, even if those objects might read from the flutter root.
2020-11-05 15:21:05 -08:00
Jenn Magder bc2a4a6498
Update CocoaPods recommended version to 1.9 (#69809) 2020-11-05 15:13:22 -08:00
Jonah Williams ed1189259e
[flutter_tools] forward all args to pub (#69784)
Change forwarding command to pass through all args, even -h - this allows flutter to support all of the pub flags without needing to declare them.
2020-11-05 14:23:24 -08:00
Jenn Magder 1be922c353
Build either iphoneos or iphonesimulator App.framework, not both (#69840) 2020-11-05 14:22:24 -08:00
Dan Field cfcb9887c9
Do not use --first-parent when determining version on master (#69726) 2020-11-05 10:11:32 -08:00
Jonah Williams e8efde6a54
[versions] update more null safe versions (#69892) 2020-11-05 09:09:03 -08:00
Vyacheslav Egorov 4c24eb10b8
Revert "Fix: fix android studio 4.1 plugin path for macOS" (#69870)
This reverts commit 422a97d1e5 due to https://github.com/flutter/flutter/issues/69863
2020-11-05 11:18:00 +01:00
Jenn Magder 2f3cccc4f5
Run more xcodebuild commands in native arm on Apple Silicon (#69837) 2020-11-04 19:54:02 -08:00
Jenn Magder 3145c835ed
Deprecate build ios-framework --universal (#69720) 2020-11-04 19:44:04 -08:00
Mokusesei 422a97d1e5
Fix: fix android studio 4.1 plugin path for macOS (#69364) 2020-11-04 17:25:53 -08:00
Shi-Hao Hong 0963d72582
Make resource attributes optional for simple cases (#68774) 2020-11-05 08:11:53 +08:00
Jenn Magder cb5263e191
Methods in build_ios_framework for universal and XCFrameworks (#69736) 2020-11-04 15:44:03 -08:00
Jonah Williams 580cacf4bd
[versions] roll versions (#69810) 2020-11-04 15:38:58 -08:00
Jonah Williams 0ddb1ae713
fix hot reload benchmark data (#69798) 2020-11-04 11:43:24 -08:00
Jonah Williams 6cec03c7c1
[flutter_tools] do not reload sources if no sources changed (#69450)
If no source files were changed by a hot reload, do not send the reload sources RPC. This slightly speeds up the no-op reloads and gives users a faster way to force a re-render.
2020-11-04 11:15:30 -08:00
Jenn Magder 53410c4bb9
Compile snapshot_assembly with sdk root set in Xcode (#69731) 2020-11-04 10:32:01 -08:00
Jenn Magder 91b82347af
Build App.framework directly to build directory (#69699) 2020-11-03 12:48:25 -08:00
Emmanuel Garcia 212967449b
Update plugins dependencies for the Gallery test (#69630) 2020-11-03 12:03:18 -08:00
Jonah Williams d0202131fd
[flutter_tools] support --extra-gen-snapshot-options everywhere --extra-front-end-options is specified (#69592)
support --extra-gen-snapshot-options everywhere --extra-front-end-options is specified
2020-11-03 10:11:14 -08:00
Jonah Williams fb90544cab
[flutter_tools] remove unused or no longer useful code (#69547) 2020-11-02 22:48:03 -08:00
Jonah Williams a2a4e9eda4
Revert "Build App.framework directly to build directory (#69612)" (#69641)
This reverts commit b77088319a.
2020-11-02 20:12:47 -08:00
Jenn Magder b77088319a
Build App.framework directly to build directory (#69612) 2020-11-02 18:48:03 -08:00
Andy Weiss c4ceea397a
[flutter_tools] Support zipped application bundles for macOS (#68854)
* [flutter_tools] Support zipped application bundles for macOS

It is not possible to directly produce a directory (.app) in some build systems
but rather it must be zip'ed before being passed to the tool for
running. This adds support for attempting to extract an application
bundle from a zip file if the bundle is not already a directory. This
uses very similar code from lib/src/application_package.dart which is
used for extracting an ipa for iOS.

This introduces tests for the macos/application_package.dart behavior which did not exist before. These tests cover the changes in the PR and some of the existing behavior, but do not cover everything in that file.
2020-11-02 08:58:33 -08:00
Shi-Hao Hong 4996f60b20
[gen_l10n] Fix unintended use of raw string in generateString (#69382)
* Fix failing tests from introducing raw string generation in gen_l10n tool
2020-10-31 19:24:53 +08:00
Jenn Magder de5bf09e7a
Show macOS arm64 architecture in doctor and devices list (#69245) 2020-10-30 13:48:04 -07:00
Jonah Williams 3e41962dff
[null-safety] update tests and tool auto-detection for null safe dart (#69405)
Disable null safety auto-detection for the web
2020-10-30 13:42:54 -07:00
Jonah Williams 22724370cb
[flutter_tools] do not delete web directory during flutter build web (#69115) 2020-10-30 11:00:24 -07:00
Jonah Williams a0860f6e87
[flutter_tools] retry sever socket setup (and port selection if port is unspecified) (#69351)
Fixes #69348

If the web development server fails to bind, then retry up to 5 times. If a port was not provided, select a new free port each time.
2020-10-29 20:07:34 -07:00
Jonah Williams 44d0e52d20
[flutter_tools] remove fallback discovery and observatory timeout (#68756)
The flutter run failures are cause by the application occasionally taking a long time to start up. This caused the ios fallback discovery to kick in, which will always fail if the application hasn't started. Solution: remove the iOS fallback discovery and wait up to 30 seconds.

This has not proven to reduce the flakes, but it does at least remove one error case and removes code that will no longer work without the mDNS fallback.
2020-10-29 18:43:47 -07:00
Angjie Li 3056f4194a
Fix issue with --web-renderer. (#69319) 2020-10-29 14:43:06 -07:00
Yegor 2fa03438de
add web_long_running_tests shard containing long-running web tests (#67324) 2020-10-29 14:23:02 -07:00
Shi-Hao Hong a2b93b86f6
[gen_l10n] Add base method code comments for improved discoverability (#69016) 2020-10-29 14:03:05 -07:00
Angjie Li 2bbd004682
Support --web-renderer options which would allow user to specify which rendering backend to use. (#68848) 2020-10-28 17:32:09 -07:00
Jonah Williams ed5d8718c4
[flutter_tools] conditionally invoke pub run test for drive scripts based on presence of dependency (#69246)
* [flutter_tools] conditionally invoke pub run test for drive scripts based on presence of dependency
2020-10-28 17:32:05 -07:00
Jonah Williams 735f6eec2c
[flutter_tools] support ws scheme in use-existing-app (#69244) 2020-10-28 15:09:46 -07:00
Jonah Williams d306c37bc4
[flutter_tools] fix --use-existing-app (#69237) 2020-10-28 13:55:29 -07:00
Jacob MacDonald 506d0f09c0
opt out the listener.dart generated file (#69223) 2020-10-28 12:52:04 -07:00
Jonah Williams 8b9e9680d2
[flutter_tools] use throwToolExit in flutter drive (#69220)
* [flutter_tools] use throwToolExit

* Update drive.dart
2020-10-28 11:40:39 -07:00
Danny Tuppeny e71655b7e9
Include VS Code + Android Studio URLs in the No IDE message (#69194) 2020-10-28 11:17:06 -07:00
Jonah Williams 9e5e763ebe
[flutter_tools] document flutter root initialization (#67884)
Moves the flutter root initialization to a static method on the cache. This is a small step towards making this functionality non-static and instead injected like normal members - however, completely removing all of the static-ness at once was too large of a change.

Instead document and add unit tests and change existing code as little as possible.

#47161
2020-10-27 15:20:07 -07:00
Anurag Roy cd690f9559
[flutter_tools] Add --verify-only flag to flutter upgrade (#68866)
* Add --verify-only flag for flutter upgrade
2020-10-27 14:06:39 -07:00
Jonah Williams 18f0a2288e
[flutter_tools] update to vm_service 5.2.0, update to dwds 7.0.0 (#69067)
Rolls in several fixes to web tooling, including better handling of absolute file imports. Updates to latest vm service to unblock null safety mode query

Co-authored-by: Gary Roumanis <grouma@google.com>
Co-authored-by: Anna Gringauze <annagrin@google.com>
2020-10-27 13:55:32 -07:00
Dan Field 36f9af3f55
reland driver vm_service migration (#69126)
* One more reland of "Driver vm service (#68654)" (#69074)" (#69077)" (#69089)"

This reverts commit e5814756a2.

* pub run test
2020-10-27 11:30:24 -07:00
Jonah Williams 3300a1bd68
[flutter_tools] eagerly set asset directory path, cache flutter views, simplify error handling (#68978)
Performs some small cleanup on the hot reload code path.

- Combines nested try/catch into single try catch, update on clause now that package:vm_service is used and Map does not need to be caught.
- Cache FlutterViews for the lifetime of the hot reload method handler
- Set asset directory path once during startup and remove conditional set during hot reload
2020-10-27 09:20:05 -07:00
Jonah Williams 6cd847c767
[flutter_tools] update test platform to use buildInfo instead of mode + additional params (#69033) 2020-10-26 18:50:17 -07:00
Jonah Williams e0ec9a06dc
[flutter_tools] Make ApplicationPackageFactory inject dependencies for Android Builds (#67827)
* [flutter_tools] simplication of application store logic

* maybe return null

* fix install tests

* Clean up imports

* revert windows test

* remove unused import
2020-10-26 16:51:32 -07:00
Jonah Williams e7b66ac7ad
[flutter_tools] do not include AS validator if android is not enabled (#69047) 2020-10-26 15:59:00 -07:00
Jonah Williams 2e54c4a8ea
[flutter_tools] implement safe file copy with multiple fallbacks (#69000)
The tool observes a large number of unhandled exceptions during the file copy portion of flutter create. it is difficult to tell whether the permission issue is caused by the source/destination, or whether it is due to a bug in dart:io.

To work around this, implement a permission check for both the source and dest files. If either fails, the tool can exit with a more specific message.

If these checks pass, then perform the actual copy. If the copy fails, fallback to manually copying the bytes
2020-10-26 15:49:07 -07:00
Jacob MacDonald 193fe3e980
Update null safe deps to prepare for the 2.12 sdk version (#69041)
* update pinned null safety deps

* run update-packages

* add http dep to devicelab package

* rerun update-packages
2020-10-26 14:31:13 -07:00
Alexandre Ardhuin 17cdf5559d
enable unnecessary_string_escapes and use_raw_strings (#68302) (#69025) 2020-10-26 12:42:05 -07:00
Jonah Williams 183fe75d58
[flutter_tools] reland: drive service (#68887)
Overhaul of flutter drive in order to deliver a better experience, namely:

* flutter run and flutter drive now share more flags, so code paths that were previously only testable on run are now testable on drive.
* Removes web-initialize-platform as this is no longer used
* flutter drive correctly sets up a logger that shows native exceptions, by connecting to the vm service.
* VM service connection now provides access to memory info without launching devtools (only for debug/profile mode)

Web changes

* Passes on the one test in the repo, otherwise the webdriver code has been isolated as much as possible

Additional NNBD related bug fixes:

No longer passes --enable-experiment to the test script. (FYI @blasten ). earlier we might have assumed that the flutter gallery benchmarks would be migrated along side the app and flutter driver, but only the app under test needs to be migrated. The test scripts should never be run with the experiment.
2020-10-26 10:11:30 -07:00
Jonah Williams 0f28edac65
[flutter_tools] null safety mode is used for dill naming (#68898)
* [flutter_tools] null safety mode is used for dill naming

* add bad test case
2020-10-23 15:39:58 -07:00
Jenn Magder 832d776b15
Stop debugger when iOS app crashes (#68844) 2020-10-23 14:12:04 -07:00
Jenn Magder 59544e377d
Apple silicon arch -arm64 -> -arm64e (#68855) 2020-10-23 13:48:38 -07:00
Jonah Williams 424ea0958b
[flutter_tools] make android deps no longer required for flutter doctor (#68533) 2020-10-23 12:37:04 -07:00
Jonah Williams cb67513f29
[flutter_tools] Reland: simplify pub cache logic (#67589)
There have been some more additional reports of a missing 'package:characters' import after upgrading flutter. 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.

Also takes an opportunity to fix the kernel snapshot depending on the .packages or package_config. Due to the generated: date field this causes extra rebuilds. Instead when pub get is run, write out an additional file with just the package contents and version.

Fixes #66777
Fixes #65723
2020-10-23 10:00:56 -07:00
Jenn Magder 351ccf7eaf
Better error message when export options plist does not a fix (#68826) 2020-10-22 23:28:51 -07:00
Jonah Williams 1edec6fc20
Revert "[flutter_tools] refactor drive launch into separate service, split by mobile+desktop and web (#68451)" (#68845)
This reverts commit 2e75f52ae4.
2020-10-22 19:39:33 -07:00
Jonah Williams 2e75f52ae4
[flutter_tools] refactor drive launch into separate service, split by mobile+desktop and web (#68451)
Overhaul of flutter drive in order to deliver a better experience, namely:

flutter run and flutter drive now share more flags, so code paths that were previously only testable on run are now testable on drive.
Removes web-initialize-platform as this is no longer used
flutter drive correctly sets up a logger that shows native exceptions, by connecting to the vm service.
VM service connection now provides access to memory info without launching devtools (only for debug/profile mode)
Web changes

Passes on the one test in the repo, otherwise the webdriver code has been isolated as much as possible

Additional NNBD related bug fixes:

No longer passes --enable-experiment to the test script. (FYI @blasten ). earlier we might have assumed that the flutter gallery benchmarks would be migrated along side the app and flutter driver, but only the app under test needs to be migrated. The test scripts should never be run with the experiment.
2020-10-22 15:07:02 -07:00
Jenn Magder f63d56e455
App.framework must support iOS 8 for older Flutter projects (#68729)
* App.framework must support iOS 8 for older Flutter projects

* Fix test
2020-10-22 13:50:54 -07:00
Jonah Williams 37470dfc0b
[devicelab] de-flake iOS launch (#68790)
* [devicelab] de-flake iOS launch
2020-10-22 13:37:57 -07:00
Jonah Williams 21ca1f9ba5
[flutter_tools] use --no-print-incremental-dependencies for non-resident and test compiles (#68678) 2020-10-22 13:34:59 -07:00
Jonah Williams 37042fdb08
[flutter_tools] remove iOS screenshot on failure functionality (#68650)
* [flutter_tools] remove iOS screenshot on failure functionality

* remove all screenshot code
2020-10-22 13:34:07 -07:00
Jenn Magder f877266139
Add CocoaPods sudo installation note (#68542)
* Add CocoaPods sudo installation note

* Refer to instructions
2020-10-22 13:33:35 -07:00
Jenn Magder 04657354f5
Build IPA command (#67781)
* Build IPA command

* xcarchive -> ipa
2020-10-22 13:32:51 -07: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
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
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
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
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
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
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
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
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
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 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
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 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
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
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
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
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
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
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