Commit Graph

4214 Commits

Author SHA1 Message Date
Anurag Roy
47b40601d7
[flutter_tools] Have FlutterValidator fail on non-ideal git config (#103259) 2022-06-20 19:05:07 +00:00
Jonah Williams
db829c1e20
[flutter_tools] migrate more unit tests to null safety (#106153) 2022-06-17 21:34:27 -07:00
Jenn Magder
aba0c4e6f6
Do not show diagnostic warning for disconnected iOS devices (#105971) 2022-06-18 01:52:07 +00:00
Loïc Sharma
2efa2e44fe
Add integration test for flutter build windows (#106053)
Add an integration test that verifies that `flutter build windows` produces the expected executable. In the future, this will be used to test that version information is properly stamped on the executable.

Part of https://github.com/flutter/flutter/issues/73652.
2022-06-17 17:14:18 -07:00
Jesús S Guerrero
fae31eecce
[flutter_tools] temporary directory (#105815) 2022-06-17 02:58:05 +00:00
Jonah Williams
2c15e3cae4
[flutter_tools] update test/src to null safety (#106064) 2022-06-16 16:48:03 -07:00
Sam Rawlins
f104be7ae9
Ignore body_might_complete_normally_catch_error violations (#105795) 2022-06-16 23:12:06 +00:00
Jesús S Guerrero
32b22b85de
parse build version on xcodeproj (#105908) 2022-06-16 22:26:06 +00:00
Loïc Sharma
ede7fc67f5
Add more CMake unit tests (#106076)
Currently CMake is tested entirely through `build_linux_test.dart`. However, CMake is also used for Windows builds. This adds additional "generic" tests:

1. Parsing CMake files
2. Generating CMake config files.

In the future, this will be used to test that generated CMake config files contain the expected version information, which will be used to flow version information to Windows executables.

Part of https://github.com/flutter/flutter/issues/73652.
2022-06-16 11:48:17 -07:00
Christopher Fujino
589dd8028b
[flutter_tools] print override storage warning to STDERR instead of STDOUT (#106068) 2022-06-15 23:22:06 +00:00
Jonah Williams
92034482f9
[flutter_tool] partial null safety migration of tool source code (#105798) 2022-06-15 20:02:07 +00:00
Christopher Fujino
d31c250e38
[flutter_tools] Fix leaky test (#105927) 2022-06-13 16:12:29 -07:00
Elliott Brooks (she/her)
fe57704594
Enable skipped test for Dart URI logs from DWDS (#105274) 2022-06-09 15:03:11 -07:00
Lau Ching Jun
d30ad47eda
Make flutter attach respect the --dds-port flag. (#105560) 2022-06-09 13:03:09 -07:00
Christopher Fujino
8bea63287a
[flutter_tools] add shuffle to hermetic run_tests (#105462) 2022-06-09 12:53:09 -07:00
Lasse R.H. Nielsen
c951d2d7a0
Stop using FallThroughError. (#105600) 2022-06-08 22:38:08 -07:00
Gary Qian
696110ba46
Migrate apply (#102787) 2022-06-06 17:38:06 -07:00
Nils Reichardt
64db621980
Remove new keyword in a few files (#104438) 2022-06-06 16:08:06 -07:00
Gary Qian
e9a3cbf2b4
Migrate abandon (#102789) 2022-06-06 12:58:07 -07:00
Christopher Fujino
712752d2fb
[flutter_tools] return terminal to echo and line mode before exiting resident_runner (#105283) 2022-06-06 10:19:40 -07:00
Jenn Magder
003f2b69d2
Pass run and drive --trace-systrace for iOS (#105321) 2022-06-03 16:48:11 -07:00
Gary Qian
0895130e51
Migrate status (#102785) 2022-06-03 16:43:11 -07:00
Jesús S Guerrero
3da9eee2f0
[flutter_tools] re-use findProjectRoot on flutter command (#104850) 2022-06-03 15:23:10 -07:00
Jesús S Guerrero
889a15eb9d
[flutter_tools] add needsFullRestart flag on hot runner (#104562) 2022-06-03 10:18:16 -07:00
Jenn Magder
3f1f0a8170
Add flutter build macos-framework command (#105242) 2022-06-03 10:13:08 -07:00
Emmanuel Garcia
975e04ba6d
Move corrupted zip to a separate handler and ask user (#105054) 2022-06-03 10:08:08 -07:00
jensjoha
9929446ea3
Extra timing on hot reload (#104242)
This PR adds extra timings for a hot reload.
As an example, before a user might see

> Performing hot reload...                                                
> Reloaded 1 of 788 libraries in 554ms.

With this PR it would instead be something like

> Performing hot reload...                                                
> Reloaded 1 of 788 libraries in 554ms (compile: 33 ms, reload: 153 ms, reassemble: 310 ms).
2022-06-03 08:41:14 +02:00
Jenn Magder
208a418abc
flutter drive --enable-software-rendering --skia-deterministic-rendering (#105161) 2022-06-02 13:33:08 -07:00
Jenn Magder
dffddf00a2
Refactor BuildIOSFrameworkCommand with common darwin baseclass (#105194) 2022-06-02 10:28:08 -07:00
Christopher Fujino
99d0f8f279
[flutter_tools] handle HandshakeException in httphostvalidator (#105076) 2022-06-01 14:08:13 -07:00
Christopher Fujino
ac791adbc0
[flutter_tools] flutter daemon handles a closed stdout IOSink (#105075) 2022-06-01 10:08:13 -07:00
Emmanuel Garcia
3b20fb3f89
Retry builds when SSL exceptions are thrown (#105078) 2022-05-31 19:53:12 -07:00
Gary Qian
c02be8cd47
Support string compileSdkVersion for preview android SDKs (#104662) 2022-05-31 13:08:09 -07:00
Anna Gringauze
5cd979e441
Retry getting tabs in chrome launcher on ConnectionException (#104218) 2022-05-26 15:20:11 -07:00
Gary Qian
cc733660ed
Add link to more detailed multidex information. (#104558) 2022-05-26 13:05:08 -07:00
Danny Tuppeny
147020366a
Fix issues running integration tests through DAP debug adapter (#104618)
* Fix issues running integration tests through DAP

These adapters were incorrectly trying to connect a DDS instance even when Flutter would create its own. This change disables DDS in the DAP layer and leaves it to Flutter (although it passes `--no-dds` on to Flutter if provided to the DAP process).

Also fixes an issue where we would unnecessarily connect the VM Service for tests even in 'noDebug' mode because of a change/fix that now includes a 'vmServiceUri' in the `test.startedProcess` event.
2022-05-26 09:36:30 +01:00
Michael Goderbauer
3fa355c97d
Remove dead code in tools tests (#104567) 2022-05-25 12:48:17 -07:00
Jenn Magder
09987dc00a
Migrate create command to null safety (#104484) 2022-05-24 18:48:10 -07:00
Jenn Magder
a56c5e51ae
Migrate some test files to null safety (#104469) 2022-05-24 16:53:08 -07:00
Jesús S Guerrero
336aa267f9
[flutter_tools] General info project validator (#103653) 2022-05-24 16:28:10 -07:00
Loïc Sharma
c29a7a2d22
Ignore replacement characters from vswhere.exe output (#104284)
Flutter uses `vswhere.exe` to find Visual Studio installations and determine if they satisfy Flutter's requirements. However, `vswhere.exe`'s JSON output is known to contain bad UTF-8. This change ignores bad UTF-8 as long as they affect JSON properties that are either unused, or, used only for display purposes by Flutter.

Fixes: https://github.com/flutter/flutter/issues/102451
2022-05-24 13:30:37 -07:00
Chris Bracken
f9765c136f
[tool] Add tests for FakeProcessManager (#104456)
Adds a bit more clarifying documentation to the implementation of the
outputFollowsExit case, and adds tests that verify the behaviour of
stderr, stdout of processes launched via FakeProcessManager.

Specifically:
* Verifies that stderr, stdout are not emitted immediately after process
  exit if outputFollowsExit is true. They must be emitted at least one
  turn through the event loop later.
* Verifies that ProcessResult.stderr, stdout have the type documented
  according to the encoding passted to Process.run/runSync:
  * List<int> if null is passed as the encoding.
  * String (in the default system encoding) if no encoding is specified.
  * String (in the specified encoding) if an encoding is specified.

This is additional testing relating to refactoring landed in:
https://github.com/flutter/flutter/pull/103947

Issue: https://github.com/flutter/flutter/issues/102451
2022-05-23 22:57:34 -07:00
Jenn Magder
c5d046c00c
continue->next in Ruby script (#104296) 2022-05-23 18:43:05 -07:00
Chris Sells
4c66e304d1
fixes 103234 to enable debugging Flutter apps on VR headset (#104135) 2022-05-20 21:58:09 -07:00
Loïc Sharma
52e19ef7ec
Refactor vswhere.exe integration (#104133)
`VisualStudio` calls `vswhere.exe` to find Visual Studio installations and determine if they satisfy Flutter's requirements. Previously, `VisualStudio` stored the JSON output from `vswhere.exe` as `Map`s, resulting in duplicated logic to read the JSON output (once to validate values, second to expose values). Also, `VisualStudio` stored two copies of the JSON output (the latest valid installation as well as the latest VS installation).

This change simplifies `VisualStudio` by introducing a new `VswhereDetails`. This type contains the logic to read `vswhere.exe`'s JSON output, and, understand whether an installation is usable by Flutter. In the future, this `VswhereDetails` type will be used to make Flutter doctor resilient to bad UTF-8 output from `vswhere.exe`.

Part of https://github.com/flutter/flutter/issues/102451.
2022-05-20 10:12:25 -07:00
Zachary Anderson
ab7f6e5cfe
Pass --verbosity=error to the Dart front-end (#104020) 2022-05-20 09:10:31 -07:00
Emmanuel Garcia
0052566c7e
Show custom error message when Kotlin or Gradle bump is required (#102421) 2022-05-19 14:38:13 -07:00
Christopher Fujino
586b15cbcb
[flutter_tools] Upgrade only from flutter update-packages (#103924) 2022-05-19 13:33:11 -07:00
Liam Appelbe
d2ba83d421
Use libraryFilters flag to speed up coverage collection (#104122)
* Use libraryFilters flag to speed up coverage collection

* Allow libraryNames to be null

* Unconditionally enable the reportLines flag

* Fix analysis errors
2022-05-19 12:19:52 -07:00
Jonah Williams
851c9521c7
[flutter_tools] pass --compact-async to frontend_server (#104026) 2022-05-17 19:52:10 -07:00
Jenn Magder
52ddc9d174
Handle null values during yaml metadata parsing validation (#104022) 2022-05-17 18:32:09 -07:00
Chris Bracken
9d9e272e70
[tool] Add tests for FakeProcess (#104013)
Because this class has some subtle behaviour with regards to control of
exit timing and when and how it streams data to stderr and stdout, it's
worth adding unit tests for this class directly, as well as (in a
followup patch) for FakeProcessManager.

This is additional testing relating to refactoring landed in:
https://github.com/flutter/flutter/pull/103947

Issue: https://github.com/flutter/flutter/issues/102451
2022-05-17 16:54:08 -07:00
Christopher Fujino
0116b2e77d
[flutter_tools] fix RangeError in flutter channel command (#103766) 2022-05-17 16:22:12 -07:00
Jonah Williams
2ad7ced916
[flutter_tools] pass --enable-impeller to android (#104014) 2022-05-17 15:52:09 -07:00
Aman Verma
8fbf89b9f2
[flutter_tools] throw error when argResults is null (#103827) 2022-05-17 12:37:08 -07:00
Lau Ching Jun
a633f3df32
Add ability for PrebuiltWindowsApp to accept a zip archive. (#103918) 2022-05-17 11:27:11 -07:00
Chris Bracken
928bb1229b
[tool] Consistent FakeProcessManager.run/runSync (#103947)
`FakeProcessManager` is a test-oriented implementation of `ProcessManager`
that simulates launching processes and returning `ProcessResult` objects
whose `exitCode`, `stdout`, `stderr` can be used to write platform-portable,
hermetic tests that don't rely on actually launching processes from
executables on disk. Its `run` and `runSync` methods provide asynchronous and
synchronous variants of this functionality.

Previously, the behaviour of `run` and `runSync` were inconsistent with
regards to the treatment of the `stdoutEncoding` (similarly,
`stderrEncoding`) parameters:

`run`:
* if the encoding was null, `ProcessResult.stdout` was returned as a
  String in UTF-8 encoding. This was incorrect. The behaviour as
  specified in `ProcessResult.stdout` is that in this case, a raw
  `List<int>` should be returned.
* If the encoding was unspecified, `ProcessResult.stdout` was returned as
  a `String` in the `io.systemEncoding` encoding. This was correct.
* If the encoding was non-null, `ProcessResult.stdout` was returned as a
  `String` in the specified encoding. This was correct.

`runSync`:
* if the encoding was null, `ProcessResult.stdout` was returned as a
  `List<int>` in UTF-8 encoding. This was incorrect. The behaviour as
  specified in `ProcessResult.stdout` is that in this case, a raw
  `List<int>` should be returned.
* If the encoding was unspecified, `ProcessResult.stdout` was returned as
  `List<int>` in UTF-8 encoding. This was incorrect. The behaviour as
  specified in `ProcessResult.stdout` is that in this case, a String a
  `String` in the `io.systemEncoding` encoding should be returned.
* if the encoding was non-null, `ProcessResult.stdout` was returned as a
  `String` in unknown (but probably UTF-8) encoding. This was incorrect.
  The behaviour as specified in `ProcessResult.stdout` is that in this
  case, a `String` in the specified encoding should be returned.

`_FakeProcess`, from which we obtain the fake stdout and stderr values now
holds these fields as raw `List<int>` of bytes rather than as `String`s. It
is up to the user to supply values that can be decoded with the encoding
passed to `run`/`runAsync`.

`run` and `runAsync` have been updated to set stdout (likewise, stderr) as
specified in the `ProcessResult` documentation.

This is pre-factoring for #102451, in which the tool throws an exception
when processing the JSON output from stdout of the `vswhere.exe` tool,
whose output was found to include the `U+FFFD` Unicode replacement
character during UTF-8 decoding, which triggers a `toolExit` exception
when decoded using our [Utf8Decoder][decoder] configured with `reportErrors` =
true. Because `FakeProcessManager.runAsync` did not previously invoke
`utf8.decode` on its output (behaviour which differs from the non-fake
implementation), it was impossible to write tests to verify the fix.

Ref: https://api.flutter.dev/flutter/dart-io/ProcessResult/stdout.html

Issue: https://github.com/flutter/flutter/issues/102451

[decoder]: fd312f1ccf/packages/flutter_tools/lib/src/convert.dart (L51-L60)
2022-05-17 11:15:54 -07:00
Jenn Magder
bf7a32628e
Up CocoaPods minumum to 1.10 (#103655) 2022-05-16 17:42:19 -07:00
Christopher Fujino
0ad0dc255d
[flutter_tools] fix missing cmake (#103761) 2022-05-14 11:59:07 -07:00
Jonah Williams
90a592bf36
[flutter_tools] fix test asset loading (#103667) 2022-05-14 10:59:07 -07:00
Christopher Fujino
4c417884c2
[flutter_tools] ensure linux doctor validator finishes when pkg-config is not installed (#103755) 2022-05-13 18:24:13 -07:00
Jonah Williams
73846448fe
[flutter_tools] remove assertion for deprecation .packages (#103729) 2022-05-13 12:58:39 -07:00
Jonah Williams
9f28b83c19
[flutter_tools] migrate some integration tests to null safety (#103560) 2022-05-13 09:39:10 -07:00
Alex Li
aa39fa5a88
[gen_l10n] Better blank lines in the header of generated files (#103414) 2022-05-12 16:04:18 -07:00
David Iglesias
1af8cc1183
[tools][web] Make Plugin Registrant file ephemeral. (#102185) 2022-05-11 17:54:11 -07:00
Gary Qian
e997a3abd2
Add tests for migrate command methods (#103466) 2022-05-11 11:09:08 -07:00
Anna Gringauze
29fecb5980
Provide flutter sdk kernel files to dwds launcher instead of dart ones (#103436)
* Provide flutter sdk kernel files to dwds launcher instead of dart ones

* Update log test to report all warnings

* Update licences for new files

* Addressed CR comments

* Addressed CR comments
2022-05-11 08:52:43 -07:00
Aman Verma
f86dfdd2b7
[flutter_tools] boolArg refactor (#102088) 2022-05-09 21:54:08 -07:00
Gary Qian
90a8b0561d
[flutter_tools] MigrateUtils and MigrateManifest classes (#101937) 2022-05-09 15:23:50 -07:00
Jesús S Guerrero
596e9d1c47
[flutter_tools] stringArg refactor (#103231) 2022-05-09 09:54:12 -07:00
Danny Tuppeny
4ab68bd04d
Use consistent date instead of DateTime.now() in evaluation tests (#103269) 2022-05-08 19:32:14 +01:00
Christopher Fujino
09686a04c9
[flutter_tools] add --uninstall-first flag and pipe it through to ios-deploy (#102948) 2022-05-07 11:49:07 -07:00
Jenn Magder
c6ced845e3
Remove custom unawaited, prefer dart:async version (#103212) 2022-05-07 08:49:04 -07:00
Alexandre Ardhuin
d40ee2149c
remove unnecessary .toString() (#103226) 2022-05-06 16:04:13 -07:00
Gary Qian
1b16d23747
Add debug logging to deferred components test for deflaking (#103161) 2022-05-06 02:39:08 -07:00
Jenn Magder
2e1c146eec
Update ffi gem installation instructions (#103008) 2022-05-04 13:24:08 -07:00
Zachary Anderson
577919dbfe
Don't hardcode ink sparkle spir-v (#102674) 2022-05-04 09:28:45 -07:00
Christopher Fujino
9d59532a7b
[flutter_tools] update feature defaults (#102937) 2022-05-02 15:14:09 -07:00
Jenn Magder
36be63ba19
Embed Flutter and App frameworks for add-to-app on iOS (#102538) 2022-05-02 10:44:12 -07:00
Jesús S Guerrero
780a6c422b
[flutter_tool] New command project (#102118) 2022-04-29 23:09:06 -07:00
Tim Sneath
e4bd552e59
Update features.dart (#102766) 2022-04-28 16:34:08 -07:00
Phil Quitslund
b5e7fb076c
[flutter_tools] rename local functions with _s (#102688) 2022-04-27 16:19:07 -07:00
Pierre-Louis
9644aa8d76
Fixes documentation inconsistencies around 'material' and 'material design' (#102632) 2022-04-27 09:29:06 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Zachary Anderson
4a2ed00231
[flutter_tools] Add entries to HostArtifacts for impellerc, libtessellator (#102593) 2022-04-26 13:30:45 -07:00
Jonah Williams
944fcda67f
[flutter_tools] remove UWP tooling (#102174) 2022-04-26 11:19:07 -07:00
Emmanuel Garcia
46cb9ede2f
Reduce Gradle log level in verbose output (#102422) 2022-04-25 10:30:40 -07:00
Alex Li
dca58a289b
[gen_l10n] Throw a specified exception when the language code is invalid (#102431) 2022-04-24 11:04:06 -07:00
Christopher Fujino
5a3e10047f
[flutter_tools] Add test that "Unresolve URI" warnings from DWDS are filtered from logs (#102399) 2022-04-22 15:29:07 -07:00
Elliott Brooks (she/her)
5414ef4c86
Hide unresolved DartUri log messages (#102338) 2022-04-22 12:43:39 -07:00
Jenn Magder
c9825d24dd
Handle CocoaPods ffi stderr (#102327) 2022-04-21 15:49:08 -07:00
Elsabe Ros
606e91ad63
Use the maven-publish plugin to publish AAR files. (#101891) 2022-04-19 16:34:07 -07:00
Christopher Fujino
f1e4018b58
[flutter_tools] explicitly enable macos-desktop in macos_content_validation_test.dart (#102009) 2022-04-15 20:14:08 -07:00
Chris Yang
a8da7ced35
Hide default bundle id error when xcresult detects an error (#101993) 2022-04-15 11:44:08 -07:00
Jenn Magder
1756ccc541
Set template and migrate apps to iOS 11 minimum (#101963) 2022-04-15 11:34:08 -07:00
Jason Simmons
d05d43431e
Provide a flag for controlling the dart2js optimization level when building for web targets (#101945) 2022-04-15 00:19:06 -07:00
Anurag Roy
ae805de468
[flutter_tools] Remove usage of globals.flutterGit from version (#100744) 2022-04-14 14:44:09 -07:00
Jenn Magder
fe11f57c61
Detect ARM ffi CocoaPods bus error (#101796) 2022-04-14 14:34:10 -07:00
Kaushik Iska
aeaeded715
Add VMService command to get frame rasterization metrics (#100696) 2022-04-14 13:44:05 -07:00
Lau Ching Jun
c2dc92ca88
Default to the newer version path when checking Android Studio Java path (#101862) 2022-04-13 22:49:06 -07:00