Commit graph

289 commits

Author SHA1 Message Date
Sigurd Meldgaard 2d3a5c744d
Revert "Revert "Use FlutterProject to locate files (#18913)" (#19409)" (#19456)
With a fix of a path being printed relative instead of absolute.
2018-07-20 08:00:30 +02:00
Ian Hickson f630f90d6d
Revert "enable lint unnecessary_const (#19342)" (#19423)
This reverts commit cc1cf13eec.
2018-07-16 13:30:27 -07:00
Alexandre Ardhuin cc1cf13eec
enable lint unnecessary_const (#19342) 2018-07-16 21:43:48 +02:00
Sigurd Meldgaard 6a8f904104
Revert "Use FlutterProject to locate files (#18913)" (#19409)
This reverts commit 57d78cc739.
2018-07-16 16:21:20 +02:00
Sigurd Meldgaard 57d78cc739
Use FlutterProject to locate files (#18913) 2018-07-16 09:39:37 +02:00
Alexander Aprelev 7ebf2728dc
Revert "Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)" (#19295)" (#19322)
This reverts commit cc122f1672.
2018-07-12 14:59:22 -07:00
Alexander Aprelev cc122f1672
Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)" (#19295)
This reverts commit 700cb767c9 as it
breaks Windows tests.
2018-07-11 19:52:28 -07:00
Alexander Aprelev 700cb767c9
Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)
* Revert "Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)" (#19276)"

This reverts commit cf932490b7 as it also
includes fix for type error that broke tests.

* Add type cast for dart2 type checks.

* Move up to latest goldens

* Make inDirectory() type-parameterized.

* Add typecasting to transitions_perf_test.dart and microbenchmarks.

* Add boolean flag initialization in save_catalog_screenshots.dart

* Add type conversion to gallery transition test
2018-07-11 19:26:33 -07:00
Alexander Aprelev cf932490b7
Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)" (#19276)
This reverts commit f4a038da63 as it breaks microbenchmark tests.
2018-07-11 12:48:55 -07:00
Alexander Aprelev f4a038da63
Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)
* Roll engine to rolled dart
Add connectionTimeout property to class that extends HttpOverrides.
Upgrade packages.
Add more type fixes.
Update goldens hash.
Add more type fixes.
Upgrade packages.
Fix tests.
Remove strong-mode from analysis options yaml file.
Increase dev/devicelab timeout from 2 to 10 seconds.
Added getVM to waitForViews. Fix type errors in compileExpression.

* Pick up engine revision with fix for microbenchmarks regression.
Increase default timeout from 20/30 to 60s.
2018-07-11 12:13:28 -07:00
Ian Hickson 35ad2a786d
Remove race conditions involving finding available ports (#18698)
This is an attempt to reland #18488 with less breakage on macOS.
2018-06-27 16:44:28 -07:00
Ian Hickson 6599271bf5
Revert matcher package (#18614)
The new matcher package deprecates isInstanceOf which seems eggregious.
2018-06-19 17:22:56 -07:00
Greg Spencer 08d1ec36de Roll engine to 0c119932c0d6cb30dafd75ec717d1eda76fd7651 (#18575) 2018-06-19 09:58:20 +02:00
Ian Hickson 0fa5ba43a1
Revert "Remove race conditions involving finding available ports (#18488)" (#18521)
This reverts commit 7750872251.
2018-06-15 15:37:20 -07:00
Ian Hickson 7750872251
Remove race conditions involving finding available ports (#18488) 2018-06-15 14:16:18 -07:00
Chris Bracken 2ae48845a8
Revert elimination of Dart 1 (#18460)
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)
2018-06-13 12:46:39 -07:00
Greg Spencer 6c56bb2420
Update typedef syntax to use Function notation and turn on lint for old notation. (#18362)
Now that Dart 1 is turned off, reapplying my change to turn on the prefer_generic_function_type_aliases analysis option, and fix all the typedefs to Dart 2 preferred syntax.

Also eliminated the unused analysis_options_repo.yaml file and turned on public_member_api_docs in analysys_options.yaml.

No logic changes, just changing the typedef syntax for all typedefs, and updating analysis options.
2018-06-11 15:51:45 -07:00
Alexandre Ardhuin 09276bea25
enable lint prefer_equal_for_default_values (#18156) 2018-06-05 08:50:40 +02:00
Greg Spencer b921fdc58e
Revert "Update typedef syntax to use Function notation and turn on lint for old notation. (#18035)" (#18041)
This reverts commit 3258602073.
2018-05-30 13:51:14 -07:00
Greg Spencer 3258602073
Update typedef syntax to use Function notation and turn on lint for old notation. (#18035)
Fixes #18028

Just changes typedef declarations, no logic changes.
2018-05-30 12:13:58 -07:00
Konstantin Scheglov eba194f776
Mark testWidgets() and testUsingContext() with @isTest. (#17772) 2018-05-21 11:11:23 -07:00
Todd Volkert d820e5f3b1
Use deprecated io constants (#17278)
The new values are not ready for use yet inside Google
2018-05-03 22:27:29 -07:00
Yegor b2c98f9a4e
Roll engine to e976be13c51448f89107d082ec81e2b6731671fa (#17266)
* Roll engine to e976be13c51448f89107d082ec81e2b6731671fa

* move away from deprecated constants
2018-05-03 19:24:48 -07:00
Todd Volkert f69d125954
Move Cache.flutterRoot initialization up sooner (#16057)
It's required to be set before we detect local engine.

Was broken by #15984
2018-03-29 09:16:34 -07:00
Todd Volkert f8058d7fb2
Make AppContext API not be prone to Future oddities (#16034)
Follow-up comments to #15984
2018-03-28 15:17:29 -07:00
Todd Volkert 8d11f5c763
Make AppContext immutable and race-free (#15984)
This updates AppContext per the recommendations in #15352

Fixes #15352
2018-03-28 10:58:28 -07:00
Jason Simmons 466d15433f
Use Dart 2 camel case constants (#15360) 2018-03-12 11:06:32 -07:00
Mikkel Nygaard Ravn 0d59679624
Make Flutter tooling work on Android without Xcode being installed (#15161) 2018-03-07 08:41:23 +01:00
jcollins-g 614df6949c
Android license detector in doctor, take two (#14783)
* Revert "Revert "Add android license verification to doctor and some refactoring" (#14727)"

This reverts commit d260294752.

* Add tests, fix sdkManagerEnv and use it consistently, and rearrange Status object model

* AnsiSpinner needs to leave the cursor where it found it.

* fix tests

* Const constructor warning only shows up on windows...?

* Avoid crash if we can't find the home directory

* Make pathVarSeparator return a string in the mock

* Implement review comments

* Fix out-of-order problem on stop
2018-02-28 12:09:52 -08:00
jcollins-g ca677011f8
Fix flutter tools packages_test when run off bots (#14692)
* Fix packages tests when run off bots

* Tweak dependencies to make bots happy

* Review comment
2018-02-21 09:54:07 -08:00
Mikkel Nygaard Ravn f526805e20
Fix of flutter packages get in plugin project (#14757) 2018-02-17 21:25:13 +01:00
Mikkel Nygaard Ravn 2000435728
Move plugin injection to just after pub get (#14743) 2018-02-16 10:17:28 +01:00
Mikkel Nygaard Ravn c2e1bc0322
Revert "Move plugin injection to just after pub get (#14560)" (#14734)
This reverts commit b3e4976ca2.
2018-02-15 22:55:36 +01:00
Mikkel Nygaard Ravn b3e4976ca2
Move plugin injection to just after pub get (#14560) 2018-02-15 22:17:12 +01:00
Chris Bracken 2fe364fb0b
flutter_tools: URI-decode data: URI content (#14627)
In getFlutterRoot(), scripts loaded via data: URIs are URI encoded.
getFlutterRoot() scans the contents of the data for the file:// URI path
of the Flutter SDK, which itself is URI-encoded. The end result is that
if the SDK path contains a space, the embedded file:// URI will contain
a %20. When this is encoded in a data: URI, the contents are
URI-encoded, resulting in %2520, since the % is encoded to %25.

This patch decodes the data: URI before extracting the SDK file:// URI.
2018-02-10 12:51:33 -08:00
Chris Bracken fd6baba137
Allow spaces in SDK path in flutter_tools tests (#14617)
The Flutter engine now supports package: and file: imports that resolve
to paths on disk that include spaces and other URI-escaped characters.
This patch eliminates the restriction that Dart source paths not include
%20 (or other URI-escaped characters) in their paths in flutter_tool
tests.
2018-02-09 21:43:08 -08:00
jcollins-g c81a5ed09a
fix rare flutter_tools logging crash in daemon mode (#14401)
* Populate AnsiTerminal in context for daemon launches

* Strip out AnsiTerminal additions to context since they are no longer needed
2018-02-01 09:30:53 -08:00
Chris Bracken d3705f3ea9
Add android workflow test (#14260)
Adds unit tests for AndroidWorkflow.runLicenseManager().
2018-01-24 22:27:24 -08:00
Chris Bracken 74478d186c
Extract MockAndroidSdk and static utility method (#14258)
AndroidSdk and AndroidStudio depends relatively heavily on filesystem
access to locate installed tools. Testing code that relies on either of
these classes benefits from a utility method to generate a
legitimate-looking Android SDK directory layout for testing.
2018-01-24 20:40:25 -08:00
Chris Bracken 538ba522ee
Move common process/IO-related mocks to mocks.dart (#14255)
Moves MockProcess, MockStdio and a few other useful mocks from
packages_test.dart to common/mocks.dart. These are useful for testing
code with interactive IO.

This adds a new constructor to MockProcess to provide additional flexibility.
2018-01-24 17:16:30 -08:00
Mikkel Nygaard Ravn d2d86e35c5
Bump test timeout threshold (#13661) 2017-12-18 23:04:07 +01:00
Devon Carew 0350c9ecff
route device issue diagnostics to flutter doctor (#13346)
* route device issue diagnostics to flutter doctor

* review comments

* review comments
2017-12-07 09:32:23 -08:00
Todd Volkert 137f0751b2
Add support for IOS_SIMULATOR_HOME environment variable in IOSSimulat… (#13236)
Add support for IOS_SIMULATOR_HOME environment variable in IOSSimulator.logFilePath

flutter_tools can be run on environments where the user's HOME directory
is not the root of the iOS simulators' configs. This change adds support
for such environments by allowing the caller to set the simulator root
directory via an environment variable.
2017-11-29 08:22:05 -08:00
Martin Kustermann 545ec9efb7
Add support for NDK discovery and add --prefer-shared-library option (#12788)
* Add support for NDK discovery and add --prefer-shared-library option

We would like to be able to use native tools (e.g. simpleperf, gdb) with
precompiled flutter apps.  The native tools work much better with *.so
files instead of the custom formats the Dart VM uses by default.

The reason for using blobs / instruction snapshots is that we do not
want to force flutter users to install the Android NDK.

This CL adds a `--prefer-shared-library` flag to e.g. `flutter build
apk` which will use the NDK compiler (if available) to turn the
precompiled app assembly file to an `*.so` file.  If the NDK compiler is
not available it will default to the default behavior.

* Rebase, add test for NDK detection, augment flutter.gradle with @Input for flag

* Use InMemoryFileSystem for test

* Remove unused import

* Address some analyzer warnings
2017-11-21 15:44:03 +01:00
Mikkel Nygaard Ravn c936aa8cd4
One more timeout. Centralize definitions. (#12970) 2017-11-10 15:56:17 +01:00
Ian Hickson e1fa035b69 Retry on failed download. (#12293) 2017-09-28 17:37:34 -07: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
Mikkel Nygaard Ravn 8303fff8f9 Run pub in interactive mode in flutter packages pub (#11700) 2017-09-06 11:53:39 +02: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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
Jakob Andersen e93f4a57a1 iOS: Make flutter doctor unhappy if CocoaPods is missing. (#8979) 2017-03-27 12:11:14 +02: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
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
John McCutchan 31dc3c4722 Try all possible Android SDK locations before giving up (#8730)
Fixes #8618
2017-03-13 11:21:34 -07: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
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
Todd Volkert 1ada132ee8 Add first replay test (#8628) 2017-03-09 12:58:31 -08:00
Alexandre Ardhuin 329e52c02c apply upcoming rule use_collection_literals_when_possible (#8649) 2017-03-08 14:57:31 -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
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 7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -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 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
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
Michael Goderbauer e552832635 fix tests on Windows for flutter tools (#8322) 2017-02-21 16:56:37 -08:00
Todd Volkert 0d2c9670fd Resolve TODOs to migrate from OperatingSystemUtils to Platform (#8314) 2017-02-21 15:11:49 -08:00
Michael Goderbauer ac7954c11a Migrate from touch cmd to dart's built-in API (#8313)
This enables us to run more tests on Windows.
2017-02-21 15:11:37 -08:00
Michael Goderbauer 8c9e18ad0e Workaround for package:test bug (#8304)
Works around https://github.com/dart-lang/test/issues/545
2017-02-21 11:26:43 -08:00
Alexandre Ardhuin 2888139c6b prefer const constructor (#8292) 2017-02-20 14:07:16 -08:00
Jakob Andersen 77efc38b67 Teach flutter tools to find gradle (#8241)
* Teach flutter tools to find gradle

Flutter tools will now use Gradle from Android Studio, which is now found automatically.

flutter doctor will verify that Android Studio has been installed, and that the included Gradle is at least version 2.14.1.

It is still possible to manually configure the path to Android Studio (flutter config --android-studio-dir=XXX) or Gradle (flutter config --gradle-dir=XXX), but this should only be necessary if they're installed somewhere non-standard.

Only tested on Linux and macOS for now.

Fixes #8131
2017-02-20 11:02:50 +01:00
Todd Volkert c233f38291 Update package:test dependencies to 0.12.18+2 (#8247) 2017-02-17 17:35:11 -08:00
Michael Goderbauer cd8434d931 Refactor how Artifacts are located (#8234)
Artifacts are now located in a central place.
This will enable us to downlaod artifacts when we need them (instead of
downloading them all upfront).
This also makes replacing sky_snapshot with gen_snapshot easier.
2017-02-16 23:10:11 -08:00
xster d7b0f7db14 Support iOS screenshot 1/2 (#8210)
* Support iOS screenshot 1/3

* Use path.join

* use fs.path instead
2017-02-16 18:35:36 -08:00
xster 3985ddbcd4 Move simulator screenshot logic to use simctl (#8216)
* Move simulator screenshot logic to use simctl

* Add simulator screenshot tests
2017-02-16 12:50:27 -08:00
Michael Goderbauer 5e54fd54d9 Ban package:path from Flutter Tools (#8119) 2017-02-13 17:45:50 -08:00
Michael Goderbauer cff7dc5444 Bump package:process version (#8073) 2017-02-10 16:54:51 -08:00
Chris Bracken 2ec6b31aac Fix potential NPE in iOS doctor check (#8016)
* Fix potential NPE in iOS doctor check

In case Xcode is not installed, the xcode-select path may be null.

* fixup! Fix potential NPE in iOS doctor check
2017-02-08 20:04:39 -08:00
Chris Bracken 4d8395e177 Improve doctor output when Xcode installation is incomplete (#8012)
If the developer has only installed the Xcode command-line tools,
xcode-select and some other tools may be present, but xcodebuild will be
missing. In this case, output a slightly improved message indicating
that the installation is incomplete rather than missing.
2017-02-08 18:56:08 -08:00
Michael Goderbauer 82f887de07 Fix Flutter Tools Tests to run on Windows (#7878) 2017-02-05 22:58:49 -08:00
Chris Bracken 165e96e214 Exit with error message if ensureDirectoryExists fails (#7874)
If ensureDirectoryExists fails -- e.g. because a file file of the same
name as the directory to be created exists, ensure that we exit cleanly
with a useful error message.
2017-02-03 17:34:12 -08:00
Chris Bracken d1d943c754 Add isToolExit, throwsToolExit test matchers (#7869)
Allows for better testing of functions that throw ToolExit to bail out.
2017-02-03 16:51:01 -08:00
Chris Bracken fb72f21cdc Improved detection of unsupported iOS devices (#7857)
* Detects iPad 2 and iPad Retina as unsupported devices.
* Simplifies blacklisting logic.
* Minor improvements to error messages.
* Added unit tests.
2017-02-03 12:25:05 -08:00
Chris Bracken 83514d67c4 Add doctor check for Python 'six' module (#7807)
* Add doctor check for Python 'six' module

Required as part of Xcode lldb module. In all likelihood, if we
encounter this situation, the developer is using a custom Python install
(e.g., via MacPorts or Homebrew).
2017-02-01 18:22:07 -08:00
Chris Bracken 5d2a460fdd Correct capitalisation of Xcode (#7796)
Ref: https://developer.apple.com/xcode/
2017-02-01 16:16:33 -08:00
Chris Bracken 18fcb91e88 Add tests for iOS doctor validaton (#7794) 2017-02-01 15:58:40 -08:00
Ian Hickson 96e11e1bf1 Clean up the file names of the hot and cold runners. (#7697) 2017-01-28 14:26:49 -08:00
xster 682c7992e5 Fix a crash (#7597) when the flutter sdk moves after getting packages (#7601)
* Add a check in case the flutter directory in .packages no longer exists. Clean up and prompt user

* Update documentation to use flutter packages get for end-users instead of flutter update-packages.

* Merge missing sdk error with the multiple sdk error. They're really the same thing.

* Use flutterPath in both checks.

* Change file_system’s copy folder to copy director which takes into account the file system

* Test support files

* Add test and split into 2 messages again.

* Move tests to run in memory file system's copy. Tested with dev/bots/test.sh
2017-01-26 15:43:28 -08:00
Todd Volkert 417c2f25fc Migrate flutter_tools to use package:platform (#7642) 2017-01-25 16:06:41 -08:00
xster ee97e5639e Change file system copy folder to copy directory (#7624)
* Change file_system’s copy folder to copy director which takes into account the file system

* Address review comments.
Test with 2 different instances of file systems.
2017-01-25 11:41:48 -08:00
Michael Goderbauer 9733aab929 Fix broken device test (#7637) 2017-01-25 11:25:07 -08:00
Todd Volkert 9ba607862e Update to package:process v1.0.1 (#7607) 2017-01-24 10:09:29 -08:00
Todd Volkert 03d163ce88 Update tools to use package:process (#7590) 2017-01-23 09:46:38 -08:00
Dan Rubel 0295def2a9 Refactor DevFS for kernel code (#7529)
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
2017-01-22 10:37:10 -05:00
Todd Volkert 016b5ab0cc Force all dart:io usage to go through 'base/io.dart' (#7390)
This ensures that accidental usages of dart:io's
file API don't creep in over time.
2017-01-09 08:37:00 -08:00
Todd Volkert 8bb270342e Update flutter_tools to use package:file throughout (#7385)
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.
2017-01-06 16:51:44 -08:00
John McCutchan 2546259a64 DependencyChecker with tests (#7268)
- [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
2016-12-15 15:05:15 -08:00
Todd Volkert 60b19b2035 Create abstraction layer for dart:io's Process commands (#7100)
With this change, they're run via instance methods on an object
obtained through the context. This will allow us to substitute
that object in tests with replay/record versions to allow us to
mock out the os-layer in tests.
2016-11-30 08:42:42 -08:00
John McCutchan 618030e044 More AppContext cleanups (#7073) 2016-11-29 11:22:48 -08:00
Dan Rubel 34e466f1fd Refactor flutter command exit code - part 3 of 3 (#6838)
* Remove the workaround that pinned args to v0.13.6
This reverts most of the changes in commit 6331b6c8b5
* throw exception if exit code is not an integer
* rework command infrastructure to throw ToolExit when non-zero exitCode
* convert commands to return Future<Null>
* cleanup remaining commands to use throwToolExit for non-zero exit code
* remove isUnusual exception message
* add type annotations for updated args package
2016-11-14 14:21:30 -05:00
John McCutchan 45c95b261d Performance fixes for hot reload when using a prebuilt loader (#6821) 2016-11-11 13:28:21 -08:00
John McCutchan fb3bf7a9d7 Support hot reload with a prebuilt loader (#6743) 2016-11-07 14:25:07 -08:00
Todd Volkert 904d524313 Add support for --use-application-binary on iOS (#6318)
Fixes #6283
2016-10-13 16:17:50 -07:00
Devon Carew 7238d93e13 fix devices test; print on test failure (#6039)
* fix devices test; print on test failure

* mock out a call to Doctor
2016-09-26 21:28:16 -07:00
Dan Rubel 672d04e0d0 close sinks cleanup (#5838)
part of https://github.com/flutter/flutter/issues/5789
2016-09-13 14:15:36 -04:00
Dan Rubel ef79e7a1c0 improve device matching error message (#5693)
* improve device matching error message
fixes https://github.com/flutter/flutter/issues/5675
2016-09-01 12:37:58 -04:00
Dan Rubel 83bf5d10c0 fix getDeviceById to match exact name (#5657)
* fix getDeviceById to match exact name
fixes https://github.com/flutter/flutter/issues/5508
2016-08-30 14:11:54 -04:00
John McCutchan cf2b2078d4 Send reload / restart time to frame to analytics (#5335) 2016-08-11 10:01:53 -07:00
Devon Carew 14483586e0 make flutter run work with a pre-built apk (#5307)
* make flutter run work with a pre-built apk

* refactor to remove the buildDir param
2016-08-09 14:38:13 -07:00
John McCutchan b6644733c9 Support for synchronizing assets onto a DevFS 2016-07-27 13:28:17 -07:00
John McCutchan 0de691621b Add --hot mode for flutter run 2016-07-20 14:38:25 -07:00
Todd Volkert cc8c78adf4 iOS tools cleanup (#4161)
* iOS tools cleanup

1) Fix `flutter install` on both device and simulator to refer to the actual
   bundle and not just the .generated folder
2) Fix `flutter run` on device to actually run vs just installing

Still TODO:
1) Discovered that isAppInstalled on iOS simulator always reports true,
   meaning it'll never actually try to install the app.

Fixes #3947
Fixes #1823
2016-05-24 16:25:40 -07:00
Devon Carew 0b5072c2ef fix check to ignore bots (#4034) 2016-05-19 10:51:31 -07:00
Devon Carew 483922d15c allow per-command analytics suppression (#3919)
* allow per-command analytics suppression

* rev the usage package dep
2016-05-15 20:06:27 -07:00
Jason Simmons a590ee2671 Remove BuildConfigurations (#3879)
Artifacts from local engine builds will be found based on the --local-engine flag
2016-05-12 12:22:15 -07:00
Jason Simmons 0f53f7966b Remove Toolchain and extend ToolConfiguration to locate host tools such as sky_snapshot (#3870)
Host tools can be found in the artifact cache directory for the host platform.
If a developer wants to use a local engine build instead, then provide an
--engine-build flag that selects the specific engine build variant.
2016-05-11 15:47:26 -07:00