...and various other minor cleanup:
* Moved "FLUTTER_STORAGE_BASE_URL" into a constant throughout the code. There are other strings that we should do that to but this one was relevant to the code I was changing.
* Fixed the logger's handling of slow warnings. Previously it deleted too much text. Fixed the test for that to actually verify it entirely, too.
* Made the logger delete the slow warning when it's finished.
* Fixed 'Please choose one (To quit, press "q/Q")' message to be the cleaner 'Please choose one (or "q" to quit)'.
* Added a debug toString to ValidationResult for debugging purposes (not used).
* In http_host_validator:
- Shortened constant names to be clearer (e.g. kPubDevHttpHost -> kPubDev).
- Added GitHub as a tested host since when you run `flutter` we hit that immediately.
- Renamed the check "Network resources".
- Updated the `slowWarning` of the check to say which hosts are pending.
- Removed all timeout logic. Timeouts violate our style guide.
- Removed `int.parse(... ?? '10')`; passing a constant to `int.parse` is inefficient.
- Replaced the `_HostValidationResult` class with `String?` for simplicity.
- Improved the error messages to be more detailed.
- Removed all checks that dependened on the stringification of exceptions. That's very brittle.
- Added a warning specifically for HandshakeException that talks about the implications (MITM attacks).
- Replaced exception-message-parsing logic with just calling `Uri.tryParse` and validating the result.
- Replaced a lot of list-filtering logic with just a single for loop to check the results.
- Replaced code that added a constant to a known-empty list with just returning a constant list.
- Revamped the logic for deciding which hosts to check to just use a single chain of if/else blocks instead of getters, lists literals with `if` expressions, `??`, functions, etc spread over multiple places in the code.
You can now specify a --local-web-sdk flag to point to a wasm_release folder. This will make it so that only artifacts that pertain to the web sdk are overridden to point to the wasm_release folder. Other artifacts (such as impellerc) will pull from the cache, or from the --local-engine path if that is specified.
This also uses precompiled platform kernel files for both ddc and dart2js
* Dart2JS build step looks for compiled platform binaries.
* Use new locations of platform binaries.
* Added --local-web-sdk command line flag.
* Need to use the matching frontend server when doing ddc stuff.
* Update packages/flutter_tools/lib/src/test/web_test_compiler.dart
Co-authored-by: Mouad Debbar <mouad.debbar@gmail.com>
* Update packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
Co-authored-by: Mouad Debbar <mouad.debbar@gmail.com>
* Formatting issues.
* Need to use URI format for platform dill.
* Fix resident runner tests.
* Fix analysis issue.
* Fix and add unit tests.
* Add some useful comments.
* Refine doc comments for flags.
Co-authored-by: Mouad Debbar <mouad.debbar@gmail.com>
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
Updates the tooling to use the GTK embedding, rather than the GLFW embedding:
- Adds new requirements to `doctor`
- Updates the app and plugin templates to make GTK-based runners and plugins
- Stops downloading and installing the GLFW artifacts
Final part of #54860, other than cleanup.
Current versions of the Windows desktop build files don't require a specific Windows 10 SDK version, but doctor still checks for one since vswhere doesn't allow for flexible queries. This has been a common source of issues for people setting up on Windows for the first time, because the current VS installer by default only includes a newer version of the SDK than what doctor is looking for.
This removes the vswhere SDK check, and instead uses a manual check for SDKs. Since this uses undocumented (although fairly widely used, so relatively unlikely to change) registry information, the check is non-fatal, so that builds can progress even if the SDK isn't found by doctor; in practice, it's very unlikely that someone would install the C++ Windows development workload but remove the selected-by-default SDK from the install.
Now that all requirements are default, the instructions when missing VS have been simplified so that they no longer list individual components, and instead just say to include default items.
Fixes#50487
Updates the Linux templates to use CMake+ninja, rather than Make, and updates the tooling to generate CMake support files rather than Make support files, and to drive the build using cmake and ninja.
Also updates doctor to check for cmake and ninja in place of make.
Note: While we could use CMake+Make rather than CMake+ninja, in testing ninja handled the tool_backend.sh call much better, calling it only once rather than once per dependent target. While it does add another dependency that people are less likely to already have, it's widely available in package managers, as well as being available as a direct download. Longer term, we could potentially switch from ninja to Make if it's an issue.
Fixes#52751