This command was previously used by the re-entrant build scripts in xcode_backend.sh and build.gradle. These have since been refactored to use flutter assemble.
Deprecation the command in preparation for removal in a future release of flutter. The only current use is a test on HHH
Ensure that the language version of the test/web generated entrypoint matches the language version of the test file to run, or the overall package language version if no annotation is provided.
The tool was setting the output preferences in a sub-context. Originally these were not injected before the arg parsers were created, though that was fixed by the lazy command creation. Once local engine is removed, the inner flutter_command Zone can be removed.
Support Microsoft Edge as a device for flutter run when web is enabled. Currently this only works on Windows, and does not include a validator for edge.
Fixes#55322
flutter analyze was unconditionally using the cached dart-sdk for analysis, and was not running with the built SDK during local engine. This broke when trying to update the analyzer for null safety, since it required us to wait for the dart change to roll into the framework first.
flutter analyze was unconditionally using the cached dart-sdk for analysis, and was not running with the built SDK during local engine. This broke when trying to update the analyzer for null safety, since it required us to wait for the dart change to roll into the framework first.
* Revert "Revert "Send text error in JSON and print in tools (#58284)" (#58872)"
This reverts commit c2d5e18cb2.
* Put streamListen in try/catch if extension events already listened for
instead of restricting profile/release mode based on whether the tool thinks the device is an emulator, restrict based on the device target architecture and the requested build mode. Notably, this enables release mode on x86_64 Android emulators, but not x86 emulators since we do not support that as an AOT target.
This does not add release mode support for simulators, since this requires us to build and upload artifacts for simulator/x86_64
* Send text error in JSON and print in tools
* Add test for error text
* Fix analysis issues
* Move streamListen to try/catch and use global.printStatus
* Extract print error fn and listen for events in web runner
* Add extension listen request to test
* Update packages/flutter_tools/lib/src/resident_runner.dart
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
* Rename error parsing method
* Allow crash if listen for extension stream fails
* Add test for error and non-error extension events
* Fix formatting for TextTreeRenderer
* Use shorter message for second exceptions
* Specify types for map
* Add empty JSON for resident_web_runner test
* Move stream listen to vmservice and add vmservice test
* Fix stream type
* Move structured error log definition to vmservice
* Use correct test matcher isNot
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
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
Make it possible for all FlutterCommands to be global free, by moving instantiation to inside the Zone context. Additionally, provide VerboseLogger and NotifyLogger (daemon) at the top level and remove from command-specific overrides.
This allows removing a work around where web devices needed to look up directly from the context in non-test code.
Technically the output preferences are still zone injected, but these will be moved soon as they were not being used correctly by the top level command (the injection comes after ArgParser reads the overflow values, causing numerous wrap issues)
Work towards removal of package:archive and ideally more stable unzipping of artifacts. These commands are available in Powershell 5+, which we already require for windows.
Also combines experiments into extraGenSnapshot/ExtraFrontEndOptions. Allows providing --no-sound-null-safety to allow out of order migration and running.
Remove copying from the shutdown stage since that seems risky. If the tool copies the first compilation there will still be a decent dill for initialization.
If a dependency specified uses-material-design: true and the main pubspec specifies uses-material-design: false, then the MaterialIcons font would be included in the font manifest, but not in the AssetManifest or final bundle. Remove it from the FontManifest if this occurs
Work towards #16723
This is only safe to land after #58131 lands in google3. Only build NOTICES in asset manfiest, and load either LICENSE or NOTICES from pubspec dependencies.
Update the flutter and dart scripts' locking mechanism and follow_links function to be more robust and support more platforms.
This adds support for using mkdir as a fallback if the system doesn't have flock instead of using shlock, since shlock doesn't work on shared filesystems.
It also fixes a problem in the follow_links function where it failed when the link resolved to the root directory.
In #55864 a race condition was described where a done event is received before we finish connecting. This cannot happen, since async functions begin synchronously and the flag isWaitingForVm is tripped immediately, keeping onDone from exiting.
Treats 'pluginClass: none' as equivalent to having no 'pluginClass'
entry on the desktop platforms, to satisy stable channel plugin
validation of Dart-only desktop plugin implementations. See
issue for full details.
Part of https://github.com/flutter/flutter/issues/57497
To simplify development of the in-progress GTK embedding, which will
replace the GLFW embedding on Linux, add the GTK artifacts to the unpack
list. This means that until the transition, both the GLFW and GTK
artifacts will be unpacked.
Part of #54860
The -S/-B format of specifying source and build directories wasn't added
until 3.13. For 3.10 compatibility, use the older form of having the
working directory as the build directory, and the last argument as the
source directory.
Fixes#57409
Throw a toolExit if the windows plugin logic runs on an invalid windows project. Update the supported project check to validate the existence of a Runner.sln file
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
When `const LocalPlatform` is used immediately and not passed as a
dependency it does not have utility over the static properties from
`dart:io`. Remove these uses to reduce the noise around how the
instantiable `Platform` class is used.
Remove caching of FlutterView. Perhaps the FlutterView RPC might return an empty list if the VM is not quite up yet? We had some old logic to poll the flutter views RPC for up to 200ms. That doesn't seem like a great approach, so instead we could forgo it entirely and trust that either the views come up before the developer tries to interact, or we crash.
Introduce BuildSystem.buildIncremental, which keeps an in-memory cache of timestamps instead of file hashes. This will be used to implement localization generation through the same build system API.
Ensure iOS and android builds can be correctly cached. Use the performance-measurement-file to verify that all targets were skipped on the second invocation. This is only run on the flutter_gallery build.
Avoid syncing unchanged versions of these files during hot restart/reload. This happens if the asset bundle needs to be built but produces identical manifests/licenses due to only asset contents changing
Support bundling SkSL shaders into an android APK or appbundle via the --bundle-sksl-path command line options. If provided, these are validated for platform engine revision and then placed in flutter_assets/io.flutter.shaders.json
The resident runner does not check if the ApplicationPackage is null when trying to stop the app. Update AndroidDevice.stopApp to handle this case by returning false.
The package will be null when flutter attach is used.
Constructing the WebDevices with the global logger too early will lead to them grabbing the StdoutLogger when running in daemon mode. This prevents IDEs from seeing the correct debug message.
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior.
- Updates tests that were previously mocking FlutterViews to use real views
- Moves the FlutterView cache from VM to FlutterDevice
- Catch SentinelException during Isolate.kill
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior.
- Updates tests that were previously mocking FlutterViews to use real views
- Moves the FlutterView cache from VM to FlutterDevice
- Catch SentinelException during Isolate.kill
- Update the Linux build to support most of the build configuration, though like windows most only make sense for profile/release.
- Ensure VERBOSE_SCRIPT_LOGGING is set when the logger is verbose
- Automatically run pub get like other build commands
- Update windows precache to include placeholder profile/release artifacts
- Update Linux and windows unpack to account for the cpp_client_wrapper code to live separate from the engine binaries
- Cleanup testing in unpack_linux and remove test cases that are covered in build_system_test.dart