Commit graph

592 commits

Author SHA1 Message Date
Todd Volkert 454db9d47c
Re-organize flutter_tools code to better support proper layering. (#12957)
* 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.
2017-11-09 21:45:31 -08:00
Devon Carew b6bd628bcd
address unused element issues and new warnings (#12890)
* address unused element issues and new warnings

* add a missing return
2017-11-08 14:06:55 -08:00
Alexandre Ardhuin 15601fe55c
Enable lint prefer asserts in initializer lists (#12903)
* enable lint prefer_asserts_in_initializer_lists

* enable --assert-initializer
2017-11-08 22:59:49 +01:00
Yegor d4830fcf1b
smoke test VM service connection before returning VMService object (#12914) 2017-11-08 10:43:47 -08:00
xster 8f79643680
Error message for unregistered phone (#12911) 2017-11-07 13:23:43 -08:00
xster c17099f474
Leave a version tag when creating project (#12846)
* Leave a version tag when creating project

* Generalize .version to .metadata
2017-11-03 10:07:57 -07:00
Alexandre Ardhuin 28366002d9 enable lint prefer_foreach (#12674)
* enable lint prefer_foreach

* fix tests
2017-10-25 08:25:44 +02:00
Alexandre Ardhuin 1fce14a31c enable lint prefer_single_quotes (#12665) 2017-10-22 18:11:36 +02:00
Jason Simmons eb475bbb80 move dart_io_entries.txt to third_party/dart for AOT builds with a local engine (#12659) 2017-10-20 15:32:27 -07:00
Alexandre Ardhuin 700dc9f752 enable lint avoid_function_literals_in_foreach_calls (#12607) 2017-10-19 08:16:16 +02:00
stevemessick 2b78675bd8 Update IDEA project files (#12391)
* Generate Android framework config

* Fix templates

* Moar templates fixing

* Minor tweaking
2017-10-05 12:56:49 -07:00
Ian Hickson 89566feeed Run pub with --trace (#12328)
See https://github.com/dart-lang/pub/issues/1714
2017-09-29 17:56:25 -07:00
Ian Hickson e1fa035b69 Retry on failed download. (#12293) 2017-09-28 17:37:34 -07:00
Chris Bracken 283f27d422 Clarify libimobiledevice installation status message (#12303)
Differentiate between 'not installed' and 'not working' and emit a more
targeted message.
2017-09-28 13:04:59 -07:00
Todd Volkert 9ea1ff12d7 Add Flags class. (#12268)
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.
2017-09-28 09:36:55 -07:00
Sarah Zakarias 3cbbbf0617 Allow empty pubspec file when building asset bundle (#12269) 2017-09-26 23:14:20 +02:00
Sarah Zakarias 49ba974710 Factor out flutter manifest logic (#12237) 2017-09-26 14:48:52 +02:00
Todd Volkert a08b5e00af Run command validation on all commands. (#12246)
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).
2017-09-25 18:56:37 -07:00
Sarah Zakarias ec2d1c9116 Add support for shared fonts in packages. (#12142) 2017-09-19 14:04:51 +02:00
Ian Hickson d658048986 Allow multiple FloatingActionButtons to be used on one screen. (#12074)
* 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.
2017-09-15 10:46:30 -07:00
Chris Bracken dd7e313317 Migrate to os_log for reading iOS simulator logs (#12079)
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.
2017-09-14 12:28:21 -07:00
Alexander Aprelev 35c47611b9 Recreate outputFileName completer, handle process launch errors. (#11980)
* Recreate outputFileName completer, handle process launch errors.

* Fix formatting

* Updated comment
2017-09-13 07:33:52 -07:00
Sarah Zakarias e5aead03cc Comments to PR #12032 (#12045) 2017-09-12 12:53:03 +02:00
Sarah Zakarias 0b95e9c278 Support transitive asset dependency (#12032) 2017-09-12 09:13:41 +02:00
Mikkel Nygaard Ravn a1f03977ca Engine artifacts used for snapshots also specified as build inputs (#12014) 2017-09-12 08:35:02 +02:00
gspencergoog 267514346a Remove legacy --plugin option from flutter create (#12020)
Removed the legacy --plugin option from flutter create.  Fixes #11815.
2017-09-11 10:01:07 -07:00
Chris Bracken 8c61116c00 Eliminate iOS log blacklist (#11981)
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.
2017-09-07 10:25:41 -07:00
Mikkel Nygaard Ravn 14016523ed Ensure snapshot rebuild logic takes main path into account (#11924) 2017-09-07 14:45:42 +02:00
Chris Bracken 39680ebfbd Suppress non-Flutter log messages in terminal (#11969)
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.
2017-09-06 19:46:40 -07:00
Mikkel Nygaard Ravn 8303fff8f9 Run pub in interactive mode in flutter packages pub (#11700) 2017-09-06 11:53:39 +02:00
Chris Bracken de736f0d43 Update minimum ios-deploy version to 1.9.2 (#11936)
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).
2017-09-05 16:26:36 -07:00
Chris Bracken c896fe2f6e Invalidate snapshot when entrypoint changes (#11913)
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.
2017-09-05 11:19:09 -07:00
Mikkel Nygaard Ravn 9be9a40948 Avoid running pub get and analyze on every project during create_test (#11932) 2017-09-05 13:17:14 +02:00
Sarah Zakarias 02c10b78d2 Bundle assets used in packages (#11751) 2017-09-05 09:42:24 +02:00
Chris Bracken 4670c9266c Bugfix in build test: ensure prev snapshot exists (#11912)
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.
2017-09-01 18:06:35 -07:00
Chris Bracken b29680cccf Improve readability of build_test JSON (#11911) 2017-09-01 18:06:13 -07:00
Alexandre Ardhuin 0783ec906b Enable lints (#11891)
* enable lint prefer_final_fields

* enable lint recursive_getters

* enable lint unnecessary_overrides
2017-09-01 22:18:51 +02:00
Chris Bracken eba6ceb85d Use idevice_id, ideviceinfo for iOS device listing (#11883)
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.
2017-09-01 10:10:49 -07:00
Ian Hickson 2cbc4a0202 Make "pub get" retry once a second when it fails. (#11882) 2017-08-31 19:35:05 -07:00
Alexander Aprelev c5750cd7ea Introduce --preview-dart-2 option to run new frontend compiler in flutter tools. (#11741)
This adds --preview-dart-2 flag that enables use of Dart 2.0 Frontend in Flutter tools.
2017-08-31 13:35:55 -07:00
Alexandre Ardhuin bb4f4070f9 Prefer const constructors (#11853)
* upgrade to linter-0.1.35

* re-enable lint prefer_const_constructors

* address review comments
2017-08-31 08:55:21 +02:00
Chris Bracken 27d3e8a41f Extract snapshotting logic to Snapshotter class (#11820)
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.
2017-08-29 10:55:14 -07:00
Chris Bracken 10e65a16f8 Minor whitespace formatting fix in build tests (#11802) 2017-08-28 15:46:45 -07:00
Chris Bracken 1ee9400130 Avoid rebuilding snapshots if no change to source (#11551) (#11793)
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
2017-08-28 11:45:17 -07:00
Chris Bracken fd54bd4caf Add version, build mode to the snapshot checksums (#11787)
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.
2017-08-25 14:32:01 -07:00
Chris Bracken dc5d2937bb Suppress libmobilegestalt noise from iOS device logging (#11745)
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>)
2017-08-23 10:50:07 -07:00
Jakob Andersen 5d0d6126a1 Add --template=<type> option to create command. (#11105)
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.
2017-08-23 13:29:31 +02:00
Mikkel Nygaard Ravn 9496e6dfa7 Support for app flavors in flutter tooling, #11676 retake (#11734) 2017-08-23 10:55:35 +02:00
Mikkel Nygaard Ravn 7c3a45dc6e Revert "Support for app flavors in flutter tooling (#11676)" (#11729)
This reverts commit 8d07d3f652.
2017-08-22 12:24:29 +02:00
Mikkel Nygaard Ravn 8d07d3f652 Support for app flavors in flutter tooling (#11676) 2017-08-22 10:38:23 +02:00
Ian Hickson 0799ff5b6c Revert "Revert "Rollback patch that broke microbenchmarks" (#11641)" (#11645)
This reverts commit 1705bf3c73.
2017-08-16 14:59:01 -07:00
Ian Hickson 1705bf3c73 Revert "Rollback patch that broke microbenchmarks" (#11641)
* 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.
2017-08-16 14:46:50 -07:00
xster bfda885a9d Fix a typo in the saved certificate error message (#11640) 2017-08-16 13:59:05 -07:00
Ian Hickson 70fe6f4c23 Rollback patch that broke microbenchmarks (#11616)
* 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.
2017-08-15 17:53:58 -07:00
Dan Rubel 3a31c35ba0 Rename .analysis_options to analysis_options.yaml (#11594) 2017-08-15 08:46:42 -04:00
Chris Bracken 309a2d78fb Extract snapshotting logic to Snapshotter class (#11591)
First step in eliminating code duplication between script snapshotting
(in FLX build) and AOT, assembly AOT snapshotting.
2017-08-11 12:58:35 -07:00
Chris Bracken bf69c3c69b Minor whitespace formatting fix (#11590)
Adds some missing spaces.
2017-08-10 16:52:25 -07:00
Jason Simmons 13dda7cf80 Signal an error in the dependency checker if an import URI is invalid (#11557)
Fixes https://github.com/flutter/flutter/issues/11539
2017-08-09 10:08:11 -07:00
Chris Bracken 74835db563 Avoid rebuilding snapshots if no change to source (#11551)
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.
2017-08-08 10:52:24 -07:00
Ian Hickson db88414131 Upgrade to the most recent test package. (#11526)
Also, add tests to verify that our coverage is actually being tested!
2017-08-04 16:33:38 -07:00
Ian Hickson 3d5afb5a81 Revert "Skip AOT snapshot build if inputs are unchanged" (#11463)
* Revert "Support space- and backslash-escaped dependencies (#11090)"

This reverts commit e6bafd0bdb.

* Revert "Skip AOT snapshot build if inputs are unchanged (#11084)"

This reverts commit b5e522e200.
2017-08-01 16:46:24 -07:00
Devon Carew a7c3bf4849 perform the initial poll for devices quicker (#11356)
* perform the initial poll for devices quicker

* add a Poller class

* test the new Poller class
2017-08-01 15:29:54 -07:00
Ian Hickson 8f56f6fdd1 Add documentation and clean up code. (#11330)
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.
2017-07-21 16:39:04 -07:00
Phil Quitslund f0c2d5eddc Flutter create widget test template. (#11304)
* Flutter create widget test template.

Running `flutter create —with-widget-test` produces a test/widget_test.dart sample widget test.

* Generate widget test bits in flutter create.

* Path fix.

* Added types.

* Skip shell testing on windows.

* formatting fixes

* Update test sample to test the sample app.

* Formatting tweak.
2017-07-21 15:11:59 -07:00
Ian Hickson 48427cb77a Revert "Flutter analyze watch improvements (#11143)" (#11328)
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`.
2017-07-20 14:47:36 -07:00
Dan Rubel e13e7806e3 Flutter analyze watch improvements (#11143)
* 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
2017-07-19 07:22:38 -04:00
Devon Carew c186d0df1c pass the value of the android sdk (#11268)
* pass the value of the android sdk

* swap flag

* allow the user to set the android-sdk location
2017-07-18 18:47:20 -07:00
Chris Bracken cf96c7db4a Clean up orphaned Instruments processes (#11189)
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.
2017-07-13 16:19:11 -07:00
xster 92750833d5 Stop sending cocoapods stats (#11120)
* Disable cocoapods stats

* Add a comment for code readers

* fix new test
2017-07-12 19:15:54 -07:00
xster 6a49419be4 Create Podfile dynamically part 1 (#11101)
* start

* with create

* refactor cocoapod code, add tests

* fix tests

* throw when cocoapod missing

* obj-c projects don’t use use_framework!
2017-07-12 18:35:08 -07:00
Seth Ladd 834fbcb867 Run target analytics (#10902)
* 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
2017-07-10 06:45:41 -10:00
Devon Carew 4891506931 add a --machine mode to flutter config (#11112)
* add a --machine mode to flutter config

* review feedback
2017-07-07 16:00:45 -07:00
Devon Carew 40a65e1fe5 minor tweaks to the output for flutter_tools (#11115)
* minor tweaks to the output for flutter_tools

* update test expectations
2017-07-07 16:00:27 -07:00
xster 1a01de9ab3 test missed a mock (#11098) 2017-07-07 14:01:28 -07:00
Chris Bracken e6bafd0bdb Support space- and backslash-escaped dependencies (#11090)
Snapshot dependency files now backslash-escape dependency paths
containing spaces and backslashes.

See: https://codereview.chromium.org/2966903003/
2017-07-05 16:36:12 -07:00
Chris Bracken 1438ae85a3 Skip snapshot build if inputs are unchanged (#11047)
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.
2017-06-30 16:09:48 -07:00
Brian Slesinsky 6841ab22be Add --name and --plain-name to 'flutter test' (#11020)
This adds a way to run only a subset of the tests.
(The new flags do the same thing as 'pub run test'.)
2017-06-29 17:26:19 -07:00
xster be228eae78 Add a dev mode doctor check (#11023) 2017-06-29 11:54:18 -07:00
xster 57746f38c0 Guess sign iOS with the first certificate when running in machine mode (#10870)
* Guess sign with the first certificate when multiple are available in machine mode

* review
2017-06-28 13:33:14 -07:00
Chris Bracken bb732b4655 Add tests for xcodeVersionSatisfactory (#10981)
And fix a typo in a test description.
2017-06-26 14:34:44 -07:00
Chris Bracken e04907a48b Ensure Xcode major, minor version always return non-null (#10980)
Previously, xcodeMajorVersion and xcodeMinorVersion returned null unless
xcodeVersionSatisfactory had been called first. We now compute them on
demand, and cache the resultant values.
2017-06-26 13:37:59 -07:00
Chris Bracken 5141c1e8e9 Add test for unknown Xcode version string (#10979)
Also, correct an existing test description.
2017-06-26 13:11:49 -07:00
Mikkel Nygaard Ravn c5999c74c0 Add gradle wrapper to project template (#10928) 2017-06-26 12:47:43 +02:00
Chris Bracken 2ebb9e5dc6 Use ProcessManager for Xcode tool invocations (#10955)
1. Run all Xcode tool invocations through ProcessManager, which allows
us to mock out failures, etc. for tests.

2. Add said tests.
2017-06-23 18:50:27 -07:00
Zachary Anderson 09bdab201d [fuchsia_reload] Use ssh instead of netcp/netruncmd (#10436) 2017-06-22 22:08:20 -07:00
Hans Muller b55441a027 Do not require main asset files if variants are provided (#10901) 2017-06-22 16:45:57 -07:00
Zachary Anderson 4d490666b3 Clean up pre-existing DevFS during creation (#10843) 2017-06-22 09:48:31 -07:00
xster 02245234b6 Save development certificate choice (#10849) 2017-06-21 17:22:13 -07:00
Chris Bracken 1d9f009579 Re-enable use of instruments for iOS device lookup (#10838)
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.
2017-06-19 13:14:57 -07:00
Jason Simmons cfa0a2dbbd Look for APKs at the path used by Android Gradle plugin 3.0 (#10798)
Fixes https://github.com/flutter/flutter/issues/10630
2017-06-19 09:37:39 -07:00
Chris Bracken b2909a245a Revert use of Xcode instruments for device lookup (#10806)
* 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.
2017-06-16 19:00:31 -07:00
Chris Bracken 972be9c8b4 Make device discovery asynchronous (#10803)
Migrates DeviceDiscovery.devices and all device-specific lookup to be
asynchronous.
2017-06-16 17:47:06 -07:00
Chris Bracken 37bb5f1300 Use Xcode instruments to list devices (#10801)
Eliminates the dependency on idevice_id from libimobiledevice. Instead,
uses Xcode built-in functionality.
2017-06-16 16:02:28 -07:00
Chris Bracken 66502138af Extract all libimobiledevice invocations to IMobileDevice class (#10793)
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.
2017-06-16 14:33:49 -07:00
Yegor 3b6d84b083 modernize iOS device lookup in driver (#10780) 2017-06-16 12:58:23 -07:00
Chris Bracken bcac3166ab Eliminate direct invocations of idevice_id for iOS (#10777)
All invocations should go via the IMobileDevice class in mac.dart.
2017-06-16 10:41:48 -07:00
Chris Bracken d6ec71d2c0 Extract libimobiledevice tools interface (#10759)
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.
2017-06-15 19:03:24 -07:00
xster 432ffde52e remove usages of booted (#10741) 2017-06-15 18:25:09 -07:00
Chris Bracken 615410d2d2 Inject iOS, Android workflows via context (#10750)
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.
2017-06-15 16:11:08 -07:00
Chris Bracken 99e343a214 Re-title, format iOS device tests (#10733) 2017-06-15 12:53:13 -07:00
xster c2b0a30c57 Add more instructions and handling for first time iOS run (#10521)
* 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
2017-06-07 15:56:13 -07:00
Todd Volkert e9c7f604e9 Make generated Java folder names match package names. (#10537) 2017-06-07 13:16:16 -07:00
Devon Carew 38891a2f72 IntelliJ and Flutter plugin version checks (#10454)
* add min version checks for IntelliJ

* validate the installed versions of IntelliJ and the flutter plugin

* review comments
2017-06-02 15:23:36 -07:00
Chris Bracken 4743a806cb Minor flutter_tools test reorganization (#10356)
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
2017-05-26 16:12:42 -07:00
Hans Muller f68c6fb814 Fix package_test flakiness, init ensure terminal context entry is set (#10333) 2017-05-25 16:35:38 -07:00
Mikkel Nygaard Ravn 251d83a4b5 Add org option to flutter create (#10290) 2017-05-24 16:19:16 +02:00
Mikkel Nygaard Ravn 10f6483003 Add Swift and Kotlin templates (#10259) 2017-05-24 08:22:50 +02:00
xster 04aeef84db Let iOS flutter run auto-sign default to first profile (#10181)
* Let run default to first profile

* fix

* review notes
2017-05-23 18:05:47 -07:00
Chris Bracken dd1456ffbc Make most ios_workflow host tool calls async (#10260)
Does not yet migrate hasIdeviceId since that results in a cascade of
breaking interface changes that's significant enough for a separate
patch.
2017-05-22 16:09:48 -07:00
Chris Bracken 0e5d4a8771 Test installation status when ideviceid is not installed (#10254)
Ensure that flutter doctor returns a partial installation status when
ideviceid is not installed.
2017-05-22 14:09:37 -07:00
Todd Volkert aa9c782693 Add initial list of known Android hardware (#10249)
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
2017-05-22 10:47:02 -07:00
Alexander Aprelev 5b1e972948 Filter out '\n' from terminal input. (#10220)
* 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
2017-05-21 15:15:44 -07:00
Chris Bracken d3fbf2ae6f Avoid duplicate exceptions on VM Service Mock failure (#10197)
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.
2017-05-18 22:56:12 -07:00
Todd Volkert a253605c76 Fall back to IPv4 in devfs_test.dart (#10196)
Fixes the broken build in the Chromium bots
2017-05-18 22:41:41 -07:00
Todd Volkert e8ac331d87 Change devfs_test to use IPv6 (#10194) 2017-05-18 21:45:24 -07:00
xster 9d3fb1f309 Auto provision iOS deploy 2/3 - prompt user to choose a certificate (#10025)
* first pass

* improvements

* extract terminal.dart

* rebase

* add default terminal to context

* The analyzer wants the ../ imports in front of the ./ imports

* review notes
2017-05-18 11:26:43 -07:00
Todd Volkert 10decc7c19 Fix race condition in protocol_discovery.dart (#10092)
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
2017-05-16 08:25:51 -07:00
xster b232a84b0d Auto provision iOS deploy 1/3 - find and use the first valid code signing certs (#9946)
* 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
2017-05-15 12:54:32 -07:00
Ian Hickson 292abf7223 "flutter packages pub ..." to passthrough to dart pub (#10044) 2017-05-12 15:40:35 -07:00
Ian Hickson 7c9c5a296c Rearrange tests to more closely match code structure (#10043) 2017-05-12 10:44:52 -07:00
Ian Hickson 18eac03d76 VerboseLogger should just wrap the parent Logger (#10020)
This way, you can test things even with a VerboseLogger.
2017-05-12 10:00:11 -07:00
Jason Simmons f44ba8b9c9 Add a flutter doctor --android-licenses command that locates and runs the Android SDK license manager (#9892)
See https://github.com/flutter/flutter/issues/8438
2017-05-09 10:18:45 -07:00
Yegor aba6095444 make zero-device test hermetic (#9891) 2017-05-08 17:57:20 -07:00
Michael Goderbauer ca4d7211b0 Enforce valid package names on flutter create (#9854)
* Enforce valid package names on flutter create

Fixes #9564

* refactor

* fix other tests
2017-05-08 14:08:59 -07:00
Todd Volkert a29585298e Add level field to the "showMessage" daemon event. (#9889)
Spawned from a discussion in https://github.com/flutter/flutter-intellij/pull/1003
2017-05-08 11:49:47 -07:00
xster 31b958378a Report flutter doctor success/failure (#9664)
* record doctor failures

* fully mock out analytics dependencies
2017-05-08 11:10:36 -07:00
xster c74225e00d Report timing on failed executions too (#9661)
* handle errors

* review notes
2017-05-08 11:10:21 -07:00
Todd Volkert 6a4b08bec6 Make DeviceDomain echo a msg if doctor says it can't list anything (#9749)
This message will be picked up by IntelliJ and shown to the user in a toast.
2017-05-03 16:12:08 -07:00
Todd Volkert 31000ef77e Remove unused code in adb.dart (#9732) 2017-05-02 21:12:28 -07:00
xster 85b2b86939 CocoaPods flow step 3 - don't automatically pod setup (#9703)
* Don’t automatically pod setup if the user never did it

* fix/add test

* rename getters
2017-05-02 16:11:37 -07:00
xster 66ed8de745 Record flutter run success/fail, build mode, platform, start time in analytics (#9597)
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
2017-04-27 15:28:15 -07:00
Devon Carew 9ac2e44ee7 add a regression test for daemon device notification (#9618)
* add a regression test for daemon device notification

* revert event send simplification
2017-04-27 09:30:47 -07:00
Zachary Anderson 0770c3c14f [flutter_tools] Adds some support for '-d all' (#9585) 2017-04-26 21:49:38 -07:00
Todd Volkert e2cd78358f Fix missing await (#9617)
Fixes #9612
2017-04-26 13:14:31 -07:00
Michael Goderbauer 460561bad8 Make Flutter plugins usable from a Windows host (#9599)
Note: In a cross-platform context `Uri.path` is not a valid file path. Allways use `fs.path.fromUri` to convert.
2017-04-26 10:02:22 -07:00
Todd Volkert 60c5ffc1a9 Switch many Device methods to be async (#9587)
`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
2017-04-25 17:23:00 -07:00
Michael Goderbauer ad1c497c03 Do not lower-case paths during canonicalization. (#9571)
* Do not lower-case paths during canonicalization.

This breaks hot reload on some platfroms with case insensitive file systems.

* Add unit tests
2017-04-25 10:34:43 -07:00
Todd Volkert a3f0f6911b Remove replay test (#9542)
It's going to be replaced by #8963

Fixes #8947
2017-04-24 08:47:38 -07:00
Alexandre Ardhuin 35803c2297 comprehensive list of lints (#9330)
* comprehensive list of lints
* add comments to commented out lint
* fix unnecessary_this lints
* exclude prefer_final_fields
2017-04-20 09:38:57 +02:00
Mikkel Nygaard Ravn cb220c85be Add test of flutter create --plugin (#9459) 2017-04-19 00:00:39 +02:00
Devon Carew 4631717f1b De-duplicate the dartanalyzer command output (#9441) 2017-04-18 14:02:06 -07:00
John McCutchan 2c1bb355dd Do less file system crawling when we have the Dart dependency set (#9424)
- [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.
```
2017-04-17 11:20:04 -07:00
Ian Hickson 00dfa224d1 Be more consistent about how stack traces are output from flutter_test (#9361) 2017-04-13 12:31:04 -07:00
Yegor 5efbe05f04 do not warn about out-of-date Flutter installation too often (#9271)
* do not warn about out-of-date Flutter installation too often

* style fix
2017-04-10 13:21:02 -07:00
Alexandre Ardhuin 610955f81d upgrade to linter-0.1.30 (#9297)
* upgrade to linter-0.1.30

* add prefer_is_empty lint
* add directives_ordering lint
* add no_adjacent_strings_in_list lint
* add no_duplicate_case_values lint
* add prefer_collection_literals lint
* add prefer_const_constructors lint
* add prefer_contains lint
* add prefer_initializing_formals lint
* add unnecessary_null_aware_assignments lint
* add unnecessary_null_in_if_null_operators lint
2017-04-08 08:43:19 +02:00
Yegor 361afef305 fix checkLockAcquired: support re-entrant locking (#9272)
* fix checkLockAcquired: support re-entrant locking

* add test; address comments

* add comment
2017-04-07 21:08:53 -07:00
Michael Goderbauer 18d69b1b3e Delete Color supported test :( (#9235) 2017-04-05 16:25:20 -07:00
Michael Goderbauer a559b8df5c [Regression] Re-enable ANSI color support on Windows (#9232)
Also adds a test to make sure we don't break it again.
2017-04-05 15:44:22 -07:00
Michael Goderbauer d2abdf8e6b Roll Dart to 1.23.0-dev.11.5 (#9151)
* 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
2017-04-05 09:47:02 -07:00
Alexandre Ardhuin 189028a958 Separate the 'if' expression from its statement (#9177) 2017-04-04 21:45:50 +02:00
Yegor 93126a85e1 warn about outdated Flutter installations (#9163) 2017-04-04 10:45:43 -07:00
Ian Hickson 57b3422795 Bold each line individually (#9069)
This should make the message in Travis logs look better.
2017-04-01 17:47:09 -07:00
Jason Simmons e7f1361681 Update artifact names and remove obsolete artifacts (#9091) 2017-03-29 16:30:41 -07:00
Jason Simmons 72effdd27c Roll the engine and update for new binary names (#9089) 2017-03-29 15:31:36 -07:00
Yegor 3ef9909237 enable crash reporting in flutter_tools (#9039)
* enable crash reporting in flutter_tools

* fix analytics text; use relative paths

* fix test
2017-03-28 15:16:38 -07:00
Dan Rubel 52245e5082 update flutter analyze to call dartanalyzer 2017-03-28 08:44:15 -04:00
Todd Volkert ff61962144 Update devfs_test to use MemoryFileSystem (#8811) 2017-03-27 12:55:19 -07:00
Jakob Andersen e93f4a57a1 iOS: Make flutter doctor unhappy if CocoaPods is missing. (#8979) 2017-03-27 12:11:14 +02:00
John McCutchan 51ea62c143 Attempt to fix devfs test (#9007) 2017-03-24 12:32:45 -07:00
Ian Hickson dfb6198feb Make the flutter test tests resilient to startup lock (#8941) 2017-03-22 11:07:58 -07:00
Jakob Andersen f79b333882 Remove unnecessary Android SDK checks. (#8926)
* Remove unnecessary Android SDK checks.

* Remove unused accessors, skip replay test.
2017-03-22 13:51:28 +01:00
Michael Goderbauer 14933de986 Defer to operating system for whichAll (#8921)
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.
2017-03-21 10:23:44 -07:00
Michael Goderbauer d35a9db6fe Avoid downloading artifacts twice (#8872)
* Avoid downloading artifacts twice

* Don't update cache before `flutter upgrade` is executed (`flutter upgrade` might bump the engine version)
* Don't update cache twice during `flutter precache`

Fixes #8249.

* add test
2017-03-20 17:09:59 -07:00
Adam Barth 97816e1571 Rename Dismissable to Dismissible (#8919)
The latter is the proper spelling.

Fixes #8883
2017-03-20 16:17:08 -07:00
Alexandre Ardhuin 2166ea5b7f apply partially the upcoming unnecessary_lambdas (#8810) 2017-03-15 23:09:58 +01:00
Michael Goderbauer 15330ffbc4 Make ProcessSignals portable (#8779)
* 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
2017-03-15 11:28:14 -07:00
Todd Volkert 1b4f817b0c Make tests more hermetic. (#8765)
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
2017-03-14 10:28:56 -07:00
Ian Hickson 0edc4d2a76 Make hot mode a little less aggressive about catching errors. (#8743)
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.
2017-03-13 14:50:30 -07:00
Devon Carew 71aaa5db91 add --offline to flutter packages get (#8707) 2017-03-13 14:04:27 -07:00
John McCutchan 31dc3c4722 Try all possible Android SDK locations before giving up (#8730)
Fixes #8618
2017-03-13 11:21:34 -07:00
Jason Simmons 3d5d63a8aa Accept any nonzero exit code as a signal of failure in the missing dependency test (#8738) 2017-03-13 11:17:09 -07:00
Dan Rubel 8742fb09fa Fix tests (#8736)
* do not forward status if stream is closed
* remove devfs test timeout
2017-03-13 13:47:29 -04:00
Todd Volkert a4c58292b2 Fix and enable broken flutter_tools tests (#8720)
(follow-on to #8698)
2017-03-10 15:34:20 -08:00
Todd Volkert 5d29737a04 Bump mockito to version 2.0.2 (#8713) 2017-03-10 13:53:22 -08:00
Michael Goderbauer 03d3186531 Transfer URIs instead of platform-dependent file paths (#8701) 2017-03-10 10:13:53 -08:00
Todd Volkert 34ed3d2d24 Pay off some technical debt. (#8710)
* Rename `Device.platform` to `Device.targetPlatform` to avoid
  collision with the exported variable from `platform.dart`
2017-03-10 10:11:05 -08:00
Todd Volkert 83d411f979 Change flutter_tools tests to run via pub (#8698)
`all.dart` is no longer needed. Furthermore, it causes tests to
be skipped, or to silently fail to run anything.

Fixes #7941
2017-03-10 09:39:01 -08:00
Yegor 3146e13414 print less in flutter_tool tests (fixes #8641) (#8699) 2017-03-09 16:51:46 -08:00
Todd Volkert 1ada132ee8 Add first replay test (#8628) 2017-03-09 12:58:31 -08:00
Alexandre Ardhuin 6a2148dde9 prefer const constructors (#8594)
* prefer const constructors

* fix double throw
2017-03-08 14:58:14 -08:00
Alexandre Ardhuin ce734e8f24 apply the upcoming rule : directives_ordering (#8582) 2017-03-08 14:58:09 -08:00
Alexandre Ardhuin 329e52c02c apply upcoming rule use_collection_literals_when_possible (#8649) 2017-03-08 14:57:31 -08:00
Michael Goderbauer 644e7b131d Faster hot reload (#8600)
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.
2017-03-07 13:09:48 -08:00
Todd Volkert 3d079414ad Record/replay test infrastructure. (#8597)
This adds the test harness for record/replay tests.
2017-03-07 10:13:40 -08:00
Yegor 5e2d3e956a Clean up crash reporting code (#8602) 2017-03-07 08:45:06 -08:00
John McCutchan 24eeddc053 Request the user upgrade if the Android SDK version is 24 (#8462)
* Request the user upgrade if the Android SDK version is 24

* Update android_sdk_test.dart

* Update android_sdk.dart
2017-03-06 18:20:04 -08:00
Todd Volkert 96ccad53df Update flutter_tools test utils to prepare for record/replay tests (#8591)
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
2017-03-06 13:13:28 -08:00
Chris Bracken 33ef949efc Declare locals as final where not reassigned (#8576)
Fix a few regressions.
2017-03-03 18:40:19 -08:00
Michael Goderbauer e0c51480d2 canonicalize paths in devfs (#8565) 2017-03-03 18:21:01 -08:00
Chris Bracken 7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -08:00
Yegor 8738eb97bc add crash reporting without enabling it (#8518)
* 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
2017-03-03 16:54:47 -08:00
Michael Goderbauer d579d58702 Enable Hot Reload on Windows (backed by gen_snapshot) (#8512)
* 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
2017-03-02 10:57:27 -08:00
Alexandre Ardhuin 69b6bb87d1 prefer_is_empty and prefer_is_not_empty (#8474) 2017-03-01 22:17:30 -08:00
Todd Volkert 9dec5f9016 Change to use mockito_no_mirrors.dart (#8511)
This got missed in the last sweep due to concurrent PRs
2017-03-01 15:34:59 -08:00
Michael Goderbauer 17057bb44b [devFS] Use URI to represent paths on device (#8446)
* [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
2017-03-01 10:11:56 -08:00
Michael Goderbauer d7d73a302f fix analyzer warning (#8484) 2017-02-28 19:45:22 -08:00
Michael Goderbauer 65835af4e6 Roll forward #8467 (#8477)
* 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
2017-02-28 17:21:17 -08:00
Yegor bfef36f710 add waitUntilNoTransientCallbacks to driver API (#8475) 2017-02-28 15:58:28 -08:00
Michael Goderbauer 96ba7f76d2 Revert "Simplify path handling logic in dependency checker and devFS (#8414)" (#8467)
This reverts commit e7bde11cc3.

Reason: broke hot reload when using "package:" style imports for sources
within the same project.
2017-02-28 11:17:26 -08:00
Todd Volkert f60410fa9d Add --bug-report flag (#8435)
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
2017-02-27 15:38:47 -08:00