* executable.dart#main() depends on runner.dart#run()
* Refactor code such that non-commands don't depend on commands.
No code was actually changed in this PR - code was merely moved from
point A to point B.
This class lives in the Context and allows callers to "inject"
flag values, where flag values are first extracted from the
command arguments, then from the global arguments as a fallback.
This makes command validation happen as part of `verifyThenRunCommand()`,
using a newly introduced protected method (`validateCommand()`) rather than
a `commandValidator` property (that subclasses were responsible for manually
invoking).
* Allow FloatingActionButton to not have a heroTag.
* Allow FloatingActionButton to not have a child.
* Allow Tooltip to not have a child.
* Improve the debug output of the default FloatingActionButton hero tag.
* Improve the error message in the Hero clashing-tag case.
* Improve the debug output of the Hero widget.
* Improve the debug output of gesture-related widgets.
* Minor improvements to documentation.
* Fix some typos in comments.
* Fix some style nits.
1. Migrate simulator device log tailing to os_log toolchain
2. When the log tag (component) is available (iOS 11/Xcode 9), filter to
the set of log lines with tag 'Flutter'.
As of iOS 11 / Xcode 9, Flutter engine logs are no longer recorded in the
simulator's syslog file, which we previously read using tail -f. Instead
they're now accessible through Apple's new macOS/iOS os_log facility,
via /usr/bin/log, which supports a relatively flexible query language.
When run in non-interactive mode, /usr/bin/log buffers its output in 4k
chunks, which is significantly smaller than what's emitted up to the
point where the observatory/diagnostics port information is logged. As a
workaround we force it to run in interactive mode via the script tool.
This was introduced to suppress libMobileGestalt noise originating from
libsystem_asl.dylib. Commit 39680ebfbd
suppresses all application log messages not originating from the
app/engine iteself on iOS 10 and above. Since the log message in
question is only emitted on devices running iOS >= 10.3.0, this
blacklist no longer necessary.
On iOS 10 and above, suppress engine log messages from system components
other than Flutter. This eliminates a large amount of keyboard/plugin
related noise during edit-refresh development.
ios-deploy 1.9.2 includes fixes for a common source of Xcode breakage
(flutter/flutter#4326) with Xcode 8.3.3 + iOS 10.3.3, and is required to
to support Xcode 9 (flutter/flutter#11875).
Adds the app entrypoint as a key in the checksum file.
This change eliminates the assumption that checksummed files change when
the main entrypoint changes. In the case where there are two
entrypoints, a.dart and b.dart and a.dart imports b.dart and b.dart
imports a.dart, building the app with entrypoint a.dart followed by a
build of the app with entrypoint b.dart would result in the same
files list and checksums, but should invalidate the build.
Fix a test for build invalidation due to a change in main entry point.
Previously this test's build was always invalidated to the the lack of a
previous snapshot (as well as the change in checksums). This change
ensures that the build is invalidated only due to the change in
checksums.
This patch migrates iOS device listing from using Xcode instruments to
using the libimobiledevice tools idevice_id and ideviceinfo.
ideviceinfo was previously incompatible with iOS 11 physical devices;
this has now been fixed.
In 37bb5f1300 flutter_tools migrated from
libimobiledevice-based device listing on iOS to using Xcode instruments
to work around the lack of support for iOS 11. Using instruments entails
several downsides, including a significantly higher performance hit, and
leaking hung DTServiceHub processes in certain cases when a simulator is
running, necessitating workarounds in which we watched for, and cleaned
up leaked DTServiceHub processes. This patch returns reverts the move to
instruments now that it's no longer necessary.
Extract a Snapshotter class that can be shared between FLX snapshotting,
AOT snapshotting, and assembly AOT snapshotting. Allows for better
testability of snapshotting logic.
* Extracts script snapshotting used in FLX build.
* Adds tests for snapshot checksumming, build invalidation/skipping.
Remaining work: disentangle + extract AOT snapshotting and Assembly AOT
snapshotting logic from build_aot.dart.
This change re-introduces skipping AOT snapshot builds if input sources
and outputs have not changed since the last snapshot build, assuming a
build for the same platform in the same build mode.
This reverts commit 3d5afb5a81.
It includes the following changes relative to the original:
1. Include the entrypoint source in the checksums
2. include the build mode in the checksums
3. include the target platform in the checksums
This change ensures that snapshot build checksums used to avoid
duplicate builds are invalidated by a change to framework revision
(in case gen_snapshot is updated), as well as by build mode.
Currently, only FLX snapshotting uses checksums to avoid duplicate
builds. FLX snapshotting is always done with BuildMode.debug, so didn't
include build mode in the checksum file.
This patch supports basic filtering of log lines from physical iOS
devices, similar to existing functionality for iOS simulator logging.
This patch also suppresses the following two log messages which are
emitted at app startup on iOS 10.3 devices:
libMobileGestalt MobileGestaltSupport.m:153: pid 123 (Runner) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
Allows the user to specify the kind of project to create. The default is 'app'. Other choices are 'plugin' (the old '--plugin' behavior), and 'package'.
A Flutter 'package' is a Dart package that depends on Flutter, but does not contain native code.
Fixes#10377.
* Revert "Fix a typo in the saved certificate error message (#11640)"
This reverts commit bfda885a9d.
* Revert "Rollback patch that broke microbenchmarks (#11616)"
This reverts commit 70fe6f4c23.
* Revert "Extract snapshotting logic to Snapshotter class (#11591)"
This reverts commit 309a2d78fb.
* Revert "Minor whitespace formatting fix (#11590)"
This reverts commit bf69c3c69b.
* Revert "Avoid rebuilding snapshots if no change to source (#11551)"
This reverts commit 74835db563.
This change re-introduces skipping snapshot builds if input sources (and
outputs) have not changed since the last snapshot build, with a bugfix
to include the entry-point source in the checksum used to check whether
rebuild can be skipped. This ensures that the following sequence
invalidates the cached build, resulting in two snapshot builds:
flutter build ios lib/foo.dart
flutter build ios lib/bar.dart
This reverts commit 3d5afb5a81.
Mainly, this adds documentation to members that were previously
lacking documentation.
It also adds a big block of documentation about improving performance
of widgets.
This also removes some references to package:collection and adds
global setEquals and listEquals methods in foundation that we can use.
(setEquals in particular should be much faster than the
package:collection equivalent, though both should be faster as they
avoid allocating new objects.) All remaining references now qualify
the import so we know what our remaining dependencies are.
Also lots of code reordering in Flutter driver to make the code
consistent and apply the style guide more thoroughly.
This reverts commit e13e7806e3.
Turns out that with this patch, we aren't actually catching all
errors. For example, `flutter analyze --flutter-repo --watch` didn't
report errors in `dev/devicelab/test/adb_test.dart`.
* flutter analyze --watch auto detect if in flutter repo
* move isFlutterLibrary from AnalyzeOnce into AnalyzeBase for use by AnalyzeContinuously
* pass --flutter-repo to analysis server when analyzing the flutter repository
* enhance flutter analyze --watch to summarize public members lacking documentation
In some cases, we've seen interactions between Instruments and the iOS
simulator that cause hung instruments and DTServiceHub processes. If
enough instances pile up, the host machine eventually becomes
unresponsive.
Until the underlying issue is resolved, manually kill any orphaned
instances (where the parent process has died and PPID is 1) before
launching another instruments run.
* report run target and if it is an emulator
* don't print debug
* rename parameter, remove unused variable
* fix test
* fix comment
* tweak from review, and fix analyzer error
* send custom parameters for the event, not the session
* fix mock
* use the +1 for usage
Previously, the snapshot file was recomputed on every build. We now
record checksums for all snapshot inputs (which are catalogued in the
snapshot dependencies file output alongside the snapshot) and only
rebuild if the checksum for any input file has changed.
Previously, xcodeMajorVersion and xcodeMinorVersion returned null unless
xcodeVersionSatisfactory had been called first. We now compute them on
demand, and cache the resultant values.
This reverts commit b2909a245a.
This resubmits the following patches:
1. Use Xcode instruments to list devices (#10801)
Eliminates the dependency on idevice_id from libimobiledevice. Instead,
uses Xcode built-in functionality.
2. Make device discovery asynchronous (#10803)
Migrates DeviceDiscovery.devices and all device-specific lookup to be
asynchronous.
* Revert "Make device discovery asynchronous (#10803)"
This reverts commit 972be9c8b4.
* Revert "Use Xcode instruments to list devices (#10801)"
This reverts commit 37bb5f1300.
This is to resolve a failure that looks related to a bad install of Xcode 8.0
on our build bots and should be reinstated when the infra issue is diagnosed
and resolved.
Instruments worked well when this was originally landed, and on the
following commit, but started failing two commits after this originally
landed. Manual invocation of instruments on the build host currently
results in:
```
dyld: Library not loaded: @rpath/InstrumentsAnalysisCore.framework/Versions/A/InstrumentsAnalysisCore
Referenced from: /Applications/Xcode8.0.app/Contents/Developer/usr/bin/instruments
Reason: image not found
Abort trap: 6
```
It appears the /Applications/Xcode8.0.app/Contents/Applications
directory (which contains Instruments) is missing on the host.
Moves all remaining calls to tools that are part of the libimobiledevice
suite of tools to the IMobileDevice class. This allows for better
tracking of this dependency, and easier mocking in tests.
Extract out IMobileDevice class, move class to idevice_id, ideviceinfo
(and eventually other libimobiledevice tools such as iproxy) behind this
interface.
Add tests for the case where libimobiledevice is not installed, the case
where it returns no devices, and the case where it returns device IDs.
Eliminates the need for the device/daemon code to get at the iOS/Android
tooling indirectly via Doctor. In tests, we now inject the workflow
objects (or mocks) directly.
* Before tests
* Add the part to trust the cert on the device
* flip the error checks since some are more specific and are more actionable
* add tests
* review
Relocates two tests alongside other related tests:
* moved code_signing_test.dart alongside other lib/src/ios tests
* moved terminal_test.dart alongside other lib/src/base tests
Our emulator detection was based on a simple heuristic that was
failing for the Samsung Galaxy S8. Any heuristic is flawed since
Android devices can report whatever they want to adb, but this
change attempts to tighten the detection by listing known models
(by their ro.hardware property). Again, these values could be
spoofed by emulator system images, but it's less likely to be
an issue than with our previous (and fall-back) heuristic.
Fixes#10203
Related: #10248
* Remove '\n' from terminal input.
* Use trim instead of replaceAll
* Add unit test
* Cleanup the test
* Fixed lint
* Style adjustments
* Forgotten @override
* Revert "Forgotten @override"
Accidently added extra files.
This reverts commit 0aba24fc8e.
* Just @override change
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.
* first pass
* improvements
* extract terminal.dart
* rebase
* add default terminal to context
* The analyzer wants the ../ imports in front of the ./ imports
* review notes
For some reaosn, when we discovered our URI, we were re-instantiating
the `Completer` instance variable whose future we listen to in `nextUri()`.
This led to a race between a caller calling `nextUri()` and us discovering
the URI. If we happened to discover our URI before a caller called
`nextUri()`, then they would be left waiting on a future from the newly
allocated `Completer` (which would never complete).
Fixes#10064
* blind wrote everything except the user prompt
* works
* Add some logical refinements
* Make certificates unique and add more instructinos
* print more info
* Add test
* use string is empty
* review notes
* some formatting around commands
* add a newline
FlutterCommand.runCommand subclasses can optionally return a FlutterCommandResult which is used to append additional analytics.
Fix flutter run timing report and add a bunch of dimensional data
`adb` can sometimes hang, which will in turn hang the Dart isolate if
we're using `Process.runSync()`. This changes many of the `Device` methods
to return `Future<T>` in order to allow them to use the async process
methods. A future change will add timeouts to the associated calls so
that we can properly alert the user to the hung `adb` process.
This is work towards #7102, #9567
- [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.
```
* Roll Dart to 1.23.0-dev.11.3.
This is expected to fix the Windows crashes reported in https://github.com/flutter/flutter/issues/8912.
* fix tests
* Roll to 1.23.0-dev.11.5
* Fix tests
The old `whichAll` implementation was not considering different extensions for executables on Windows. By defering to OS-built-in tools we avoid implementing it.
Fixes#8882.
* Make ProcessSignals portable
This removes the need to wrap unsupported signals with in `if (!platform.isWindows) ..`.
It also allows us to implement a work around for breaking the Windows console when flutter is exited with Ctrl+C.
* review comments
* adding tests
* add license header
1. Add `PortScanner` abstraction so that we don't do actual port scanning
in tests.
2. Don't change the real `cwd` of the isolate during tests, as it affects
all tests, not just the current running test.
Fixes#8761
It was resulting in weird situations where the tool would dump an
error message and stack but not quit, or would fail hard but then just
hang.
Instead, specifically catch errors you expect. As an example of this,
there's one error we expect from the DartDependencySetBuilder, so we
catch that one, turn it into a dedicated exception class, then in the
caller catch that specific exception.
This implements the `DartDependencySetBuilder` completely in Dart instead of calling out to `sky_snapshot` (Linux/Mac) or `gen_snapshot` (Windows) and allows us to use the same code path on all supported host platforms.
It also slightly reduces hot reload times on Linux from ~750ms to ~690ms for the unchanged flutter_gallery app and significantly reduces hot reload times on Windows from almost 1.5s to just slightly slower than on Linux.
This change will also allow us to retire `sky_snapshot` completely in the future.
1. Add matchers for the `ProcessExit` exception class
2. Add ability to control the setup of the `AppContext` we use in
`testUsingContext()`
3. Clean up the code that figures out the location of `Cache.flutterRoot`
such that it works with `pub run test`. It previously only worked
when the tests were invoked with standalone `dart`
`#3` above will also help unblock #7941
* add crash reporting without enabling it
* do not drop futures on the floor
* return exitCode from executable run
* debug travis
* remove unnecessary todo
* rename local fs getter
* Enable Hot Reload on Windows (backed by gen_snapshot)
\o/
Two caveats:
* Hot Reload on Windows is slower than on other platforms because gen_snapshot is slower then sky_snapshot
* We currently cannot hot reload projects with spaces in the path
* enable tests
* [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
This adds support for a `--bug-report` flag, which is a recording
that:
- includes the arguments that were passed to the command runner
- is zipped up for easy attachment in Guthub issues