Commit graph

2925 commits

Author SHA1 Message Date
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
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
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
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
Gary Roumanis 16daed86c3
Persist Chrome Default Directory (#69921) 2020-11-06 10:54:04 -08:00
Jonah Williams a3f6ea6f38
[flutter_tools] split web integration tests into new shard (#69914) 2020-11-05 17:21:44 -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
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
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
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
Jonah Williams 7ceb20417c
disable hot reload web tests on CI due to flakes (#69802) 2020-11-04 12:36:33 -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
Anna Gringauze 5034d57546
Disable web expression evaluation tests (#69728)
Temporarily disable web expression evaluation tests,
until we figure out how to disable the only on non-web bot.
2020-11-03 23:36:54 -08:00
Jenn Magder 91b82347af
Build App.framework directly to build directory (#69699) 2020-11-03 12:48:25 -08:00
Jonah Williams 9ec5d7131b
Remove usage of --enable-experiment to analysis server (#69614) 2020-11-03 08:02:19 -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
Jonah Williams 9383ec793b
mark flaky tests as flaky (#69633) 2020-11-02 18:15:20 -08:00
Jonah Williams 8291f4810f
[flutter_tools] add canvaskit hot reload integration test (#69550) 2020-11-02 10:40:46 -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
Jonah Williams 324b78eb12
[null-safety] enable null safety (#69440)
* [null-safety] enable null safety

* opt expression evaluation web test out of null safety
2020-10-30 15:26:22 -07: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 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
Jonah Williams ca47b4e12c
[flutter_tools] disable failing gen l10n test (#69340) 2020-10-29 15:04:46 -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 7b0f38b117
Remove intl_translation from tool integration test (#69155) 2020-10-29 14:05:39 -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
Jonah Williams 470346f775
[flutter_tools] Reland: Stage web tests (#69264)
Enable web tool integration tests: expression evaluation, stepping, and basic hot restart
2020-10-29 09:56:28 -07:00
Jonah Williams 2ceb34e6fb
Revert "[flutter_tools] enable web integration tests (#69114)" (#69261)
This reverts commit d0cdfa4176.
2020-10-28 18:22:41 -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 d0cdfa4176
[flutter_tools] enable web integration tests (#69114)
* [flutter_tools] stage web integration tests
2020-10-28 17:31:44 -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
Danny Tuppeny e71655b7e9
Include VS Code + Android Studio URLs in the No IDE message (#69194) 2020-10-28 11:17:06 -07:00
Konstantin Scheglov 7b86be228e
Use runZonedGuarded() instead of deprecated onError. (#69160) 2020-10-28 08:43:31 -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 8c3d564ded
[flutter_tools] fix test expectation in resident_runner.dart (#69121) 2020-10-27 10:11:02 -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
Jonah Williams 8b973f01c4
[flutter_tools] add package_config.json to analyze_once_test.dart (#69059)
* [flutter_tools] add package_config.json to analyze_once_test.dart
2020-10-26 15:46:51 -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 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
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 21ca1f9ba5
[flutter_tools] use --no-print-incremental-dependencies for non-resident and test compiles (#68678) 2020-10-22 13:34:59 -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