DevFS.update only runs in Dart 2 mode when the generator parameter is
supplied. In Dart 2 mode, both mainPath and pathToReload are required
parameters; this patch marks them as such.
generator is required for running in Dart 2. All call sites other than tests already explicitly set this value.
Note the statements on line 510 and line 516 for why mainPath and pathToReload are required.
* Fixes resulting from audit of issues links
I looked at every link to GitHub in our repo. For cases where we had a TODO that was waiting for a bug to be fixed, and the bug has now been fixed, I applied the pending change. For cases where the link was out of date, I updated the link.
* Update run_test.dart
skip this test again since it failed on linux and macos bots
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`.
I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests.
While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others.
Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
* Upgrade everything except matcher.
* Roll matcher (and test)
* Adjust tests that depend on flutter:test directly to depend on a shim
* Require use of package:test shim and remove other references to package:test
fuchsia_tester.dart still assumes Dart 1. Previously, it ran tests directly
from source, flutter_platform.dart automatically runs a kernel compile when
operating in Dart 2 mode, but this assumes a functional Dart SDK is available
in the artifacts directly, and fuchsia_tester.dart mocks out the artifacts
directory with an empty temp dir.
Remaining work is:
1. Get the frontend server building as a dependency on Fuchsia.
2. Patch fuchsia_tester.dart to use a valid Dart SDK and frontend server.
This also reverts migration to Dart 2 typedef syntax.
This reverts commit 6c56bb2. (#18362)
This reverts commit 3daebd0. (#18316)
* It's time to #deleteDart1 (#18293)
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.
Eliminates --preview-dart-2 / --no-preview-dart-2 support.
* Fix indentation, remove no longer necessary .toList()
* Only push udpated kernel if >0 invalidated srcs
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.
Eliminates --preview-dart-2 / --no-preview-dart-2 support.
* Make the current command injected into the AppContext, allowing
other classes to inject the current command.
* Introduce `AssetBundleFactory`, an injected factory class for
spawning instances of `AssetBundle`. This allows other run contexts
to use custom asset bundling logic.
* Clean up RunCommand by removing a 'packages' argument that duplicated
a global argument by the same name (and for the same purpose).
Duplicate arguments are confusing and error-prone.
On failure to configure a mock VM service, we get a useful exception in
setUpAll(). This change prevents an additional failure in tearDownAll()
that provides no additional useful diagnostic info.
- [x] Skip scanning the file system if we already have the Dart dependency set.
Fixes#9376
```
Performing hot reload...
Reloaded 1 of 418 libraries in 888ms.
Performing hot reload...
Reloaded 1 of 418 libraries in 871ms.
** UNTAR dragontail under project root **
Performing hot reload...
Reloaded 0 of 418 libraries in 443ms.
** UNTAR dragontail under lib/ **
Performing hot reload...
Reloaded 0 of 418 libraries in 385ms.
```
* [devFS] Use URI to represent paths on device
Previosuly, regular file paths in the format of the host platform were used to represent paths on device. That works when host and device share the same (POSIX) file path format. With a Windows host, this breaks. URIs are the solution as they are platform independent and the VM service on the device already interpreted the file paths as URIs anyways.
* review comments
* switch to file paths
* fix tests on Windows
* review comments
* Revert "Revert "Simplify path handling logic in dependency checker and devFS (#8414)" (#8467)"
This reverts commit 96ba7f76d2.
* Intentionally use a self-package URI in flutter_gallery
* tests to catch problems with self-package imports
Refactor DevFS so that it's easier to add new types of content such as kernel code
* add tests for DevFS package scanning
* add tests for DevFS over VMService protocol
* which covers _DevFSHttpWriter and ServiceProtocolDevFSOperations
* replace AssetBundleEntry and DevFSEntry with DevFSContent
* refactor to cleanup common code and replace some fields with locals
* rework .package file generation refactor away DevFSOperations.writeSource
* only update .package file if it has changed
* only write/delete/evict assets that have been changed/removed
This removes direct file access from within flutter_tools
in favor of using `package:file` via a `FileSystem` that's
accessed via the `ApplicationContext`.
This lays the groundwork for us to be able to easily swap
out the underlying file system when running Flutter tools,
which will be used to provide a record/replay file system,
analogous to what we have for process invocations.
- [x] Introduce DependencyChecker which can determine if any dependencies have been modified.
- [x] Move the DartDependencyBuilder into a separate file.
- [x] Add unit tests for DartDependencyBuilder.
- [x] Add unit tets for DependencyChecker
Part of #7014
This change adds a top-level getBuildDirectory func and funcs for
android, aot, asset, ios build products.
Developers may now add a "build-dir" mapping to their
~/.flutter_settings (JSON format) config file. Output directory is
relative to the main flutter application directory.
This change also changes the default build directory for iOS builds to a
subdirectory of the configured build directory, 'build/ios' by default.
- [x] Update engine to bring in new snapshotter.
- [x] Use the new snapshotter to quickly determine the minimal set of files necessary to run.
- [x] On first DevFS sync, only sync files necessary to run the application.
- [x] Fix a DevFS unit test failure.
- [x] Include DevFS tests in all.dart.
* General improvoments to the loader app:
* Show a message after 8 seconds if no connection comes in.
* Show a progress bar as files are being uploaded.
* Hide the spinner just before launching the application.
* General improvements to the "flutter run" UI:
* Add "?" key as a silent alias for "h".
* Make the help text bold so it doesn't get mixed with the logs.
* Make "R" do a cold restart when hot reload is enabled.
* Supporting features and bug fixes:
* Add support for string service extensions.
* Other bug fixes:
* Expose debugDumpRenderTree() outside debug mode.
* Logger.supportsColor was missing a getter.
* Mention in the usage docs that --hot requires --resident.
* Trivial style fixes.