Commit graph

1973 commits

Author SHA1 Message Date
Ryan Macnak fce76bcfd6 Revert "Update --local-engine to account for changed host architecture of 32-bit Android debug builds. (#11251)" (#11259)
This reverts commit 3f514fcfdf.
2017-07-17 13:47:03 -07:00
Carlo Bernaschina 16ae29b56d Revert "Register tools as a reloadSources service (#11229)" (#11256)
This reverts commit 35c4989795.
2017-07-17 13:05:16 -07:00
Carlo Bernaschina 35c4989795 Register tools as a reloadSources service (#11229)
* Register tools as a reloadSources service

* Fix code style and comments

* Fix nits and Add documentation

* Format error message
2017-07-17 12:31:43 -07:00
Ryan Macnak 3f514fcfdf Update --local-engine to account for changed host architecture of 32-bit Android debug builds. (#11251)
Roll engine to 7480e32854606e554ae37f8bd241c050bdc565c4.
2017-07-17 12:20:14 -07:00
Todd Volkert b7ababe68c Remove unused DevFsProgressReporter (#11249)
Discovered dead code during review of #10791
2017-07-17 09:30:56 -07:00
Siva Chandra 28d09d1614 Fix style issues introduced by dba29aa0fc (#11203) 2017-07-14 13:51:16 -07:00
Phil Quitslund 05562d5734 Quiet debug test runner output when in machine mode. (#11228)
* Quiet debug test runner output when in machine mode.

See: https://github.com/flutter/flutter-intellij/issues/1176

* json => machine
2017-07-14 11:20:50 -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
Devon Carew bde8a5f5a6 move away froma deprecated method (#11215) 2017-07-13 16:18:40 -07:00
Jason Simmons 14648e9bae Suppress an analyzer warning about cli_util.getSdkDir deprecation (#11213) 2017-07-13 15:48: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
Chris Bracken 0adb39ae9b Avoid concurrent device polling in daemon; add timeout (#11184)
Apply a 30 second timeout to Android/iOS device polling.

If there's a device poll already in progress, skip polling for new
devices; wait for the first request to return/timeout.
2017-07-12 17:57:15 -07:00
Michael Goderbauer ae90581124 Fix build (#11186)
Was broken by dba29aa0fc, which apprently has been pushed directly to master without running through Travis?
2017-07-12 17:24:38 -07:00
Siva Chandra dba29aa0fc Select the correct conditional import when building dart dependencies.
Fixes #9413.

For more info on conditional imports, see
https://github.com/munificent/dep-interface-libraries/blob/master/Proposal.md.
2017-07-12 16:30:14 -07:00
Michael Goderbauer 561e7773c2 Fix path to flutter_tester when using local enginde on Mac OS (#11134) 2017-07-10 12:34:04 -07:00
Todd Volkert 926a096efd Minor fixes in tools: (#11009)
* Include the process' `stdout` and `stderr` when it returns a
  non-zero exit code in `runCheckedAsync()`
* Defensively catch errors in `AndroidDevice.isAppInstalled()`
  and return false
2017-07-10 10:02:11 -07:00
Devon Carew 0ac2232eda normalize the reload result messages (#11131) 2017-07-10 09:53:14 -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
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 b5e522e200 Skip AOT snapshot build if inputs are unchanged (#11084)
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 (or the previous output file) has
changed.
2017-07-05 12:49:29 -07:00
Michael Goderbauer 678c31f14c Fail doctor check "Flutter" if sub-check fails (#11087)
See https://github.com/flutter/flutter/issues/11051
2017-07-05 12:11:02 -07:00
Ian Hickson 5f20f83415 Always run the flutter tool in checked mode. (#11069)
(Needs https://github.com/dart-lang/sdk/issues/28519)
2017-07-02 09:34:31 -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
Todd Volkert f02e9acc33 Add known physical device that would otherwise look like an emulator (#11056)
https://github.com/flutter/flutter/issues/10203
2017-06-30 13:48:24 -07:00
Chris Bracken c1c1522591 Make _createSnapshot private, depfilePath required (#11054)
* Only one call to createSnapshot exists, and it's in the same library.

* Eliminate conditional logic around the presence of depfilePath, the
  only existing call always passes a non-null depfilePath.
2017-06-30 12:48:12 -07:00
xster c1e3b75cc2 Verbose cocoapods output if error or flutter is verbose (#11048)
* Output verbose cocoapods output when pod install has an error or if flutter build/run is in -v

* remove repeated stdout
2017-06-30 11:17: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
Devon Carew 94e14f0c5a increase the timeout for service discovery (#10965)
* increase the timeout for service discovery

* remove the timeout for discovering service ports
2017-06-29 14:35:20 -07:00
xster be228eae78 Add a dev mode doctor check (#11023) 2017-06-29 11:54:18 -07:00
Mikkel Nygaard Ravn 021a9ee2a2 Fix bug in prev commit (#11030) 2017-06-29 12:19:45 +02:00
Mikkel Nygaard Ravn 030abfd49a Provide user feedback on slow Gradle operations (#11015) 2017-06-29 11:54:03 +02:00
Mikkel Nygaard Ravn a106f504c7 Make flutter drive await app reinstall (#11029) 2017-06-29 11:23:27 +02:00
Mikkel Nygaard Ravn 1731a16d81 Make consistent use of gradle wrapper (#10993) 2017-06-29 09:48:01 +02: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 a41e354a55 Emit CocoaPods output if pod install fails (#11018)
In the case where the CocoaPods 'pod install' step fails, emit its
stdout to provide any potentially-useful error messages to the user.
2017-06-28 11:58:06 -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
Mikkel Nygaard Ravn c5999c74c0 Add gradle wrapper to project template (#10928) 2017-06-26 12:47:43 +02:00
Devon Carew f946171817 update our build bot exclusions (#10964) 2017-06-25 21:17:39 -07: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
Ian Hickson d131a8df42 Fix --keep-app-running default and make devicelab verboser (#10957) 2017-06-23 18:09:37 -07:00
Chris Bracken 845c1b7f01 Re-land Lazily initialise Xcode installation status (#10952)
This reverts commit 3e265e9e42.

Rather than pre-compute Xcode install path, version, and EULA status,
compute and cache on demand.
2017-06-23 16:58:14 -07:00
Chris Bracken 3e265e9e42 Revert "Lazily initialise Xcode installation status (#10945)" (#10951)
This reverts commit bb8e2a7ccd.

Triggers a doctor failure on the Mac chromebots.
2017-06-23 16:08:36 -07:00
Chris Bracken bb8e2a7ccd Lazily initialise Xcode installation status (#10945)
Rather than pre-compute Xcode install path, version, and EULA status,
compute and cache on demand.
2017-06-23 15:56:44 -07:00
Ian Hickson 9adb4a78a6 Deep linking: automatically push the route hiearchy on load. (#10894)
The main purpose of this PR is to make it so that when you set the
initial route and it's a hierarchical route (e.g. `/a/b/c`), it
implies multiple pushes, one for each step of the route (so in that
case, `/`, `/a`, `/a/b`, and `/a/b/c`, in that order). If any of those
routes don't exist, it falls back to '/'.

As part of doing that, I:

 * Changed the default for MaterialApp.initialRoute to honor the
   actual initial route.

 * Added a MaterialApp.onUnknownRoute for handling bad routes.

 * Added a feature to flutter_driver that allows the host test script
   and the device test app to communicate.

 * Added a test to make sure `flutter drive --route` works.
   (Hopefully that will also prove `flutter run --route` works, though
   this isn't testing the `flutter` tool's side of that. My main
   concern is over whether the engine side works.)

 * Fixed `flutter drive` to output the right target file name.

 * Changed how the stocks app represents its data, so that we can
   show a page for a stock before we know if it exists.

 * Made it possible to show a stock page that doesn't exist. It shows
   a progress indicator if we're loading the data, or else shows a
   message saying it doesn't exist.

 * Changed the pathing structure of routes in stocks to work more
   sanely.

 * Made search in the stocks app actually work (before it only worked
   if we happened to accidentally trigger a rebuild). Added a test.

 * Replaced some custom code in the stocks app with a BackButton.

 * Added a "color" feature to BackButton to support the stocks use case.

 * Spaced out the ErrorWidget text a bit more.

 * Added `RouteSettings.copyWith`, which I ended up not using.

 * Improved the error messages around routing.

While I was in some files I made a few formatting fixes, fixed some
code health issues, and also removed `flaky: true` from some devicelab
tests that have been stable for a while. Also added some documentation
here and there.
2017-06-23 14:58:29 -07:00
Todd Volkert f18083d448 Print ADB output when adb install fails (#10933)
Fixes #10929
2017-06-23 14:08:07 -07:00
Chris Bracken f4f81e9ac7 Require Xcode >= 8.0 for iOS development (#10932)
This allows us to take advantage of improved command-line tooling (e.g.,
improvements in device listing in Instruments). Now that the engine is
built with Xcode 8 and the framework is tested against Xcode 8, this
reduces the set of configurations we need to support to allow us to
focus on the supported ones: Xcode 8 and Xcode 9.
2017-06-23 14:07:01 -07:00
Chris Bracken 9a6a3e1e27 Delete unnecessary print statement (#10937)
This print statement provides no value to the user.
2017-06-23 14:06:10 -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
Devon Carew 963b90edf0 send the FLUTTER_HOST env var as analytics' app installer ID (#10889) 2017-06-21 13:02:40 -07:00
Seth Ladd b231006ce7 analytics expects a format of cd<integer> for custom dimensions (#10864) 2017-06-21 10:54:37 -07:00
Brian Slesinsky f01e9418fc change --machine flag for flutter test to report test progress as JSON (#10848)
(The Flutter plugin will use this to update the UI with test progress.)
2017-06-20 14:40:42 -07:00
Jason Simmons 1be406b1b5 Move the discovered Java installation to the front of PATH when running sdkmanager (#10846)
Fixes https://github.com/flutter/flutter/issues/10703
2017-06-20 09:53:01 -07:00
Seth Ladd b471a9cffc send channel name as a custom dimension (#10814)
* send channel name as a custom dimension

* tweaks from review

* remove unused import
2017-06-20 08:20:57 -07:00
Devon Carew c14470e0c7 dont' validate against webstorm (#10828) 2017-06-20 06:46:43 -07:00
Chris Bracken 400a62d121 Eliminate use of ideviceinfo in flutter_tools (#10804)
This libimobiledevice tool is no longer used anywhere in the flutter_tools codebase.
2017-06-19 13:36:05 -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
Luke Church 4b707c194f Change for consideration: URL for plugin text (#10720) 2017-06-18 21:18:36 +02: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
xster 03393510ba address comments (#10786) 2017-06-16 14:22:10 -07:00
Yegor 3b6d84b083 modernize iOS device lookup in driver (#10780) 2017-06-16 12:58:23 -07:00
Chris Bracken b474557ef4 Eliminate unnecessary public getters for iOS tools (#10784)
None of these is used outside of devices.dart and being public covers up
analysis warnings when they're unused.
2017-06-16 11:20:23 -07:00
Chris Bracken 73df49a0d9 Eliminate unused libimobiledevice tool refs (#10778) 2017-06-16 10:42:07 -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 c04f712a23 Refactor Xcode instance lookup (#10763)
Use a top-level getter in mac.dart rather than a static instance getter
and a top-level getter in ios_workflow.dart. Makes this code consistent
with how we do context lookups elsewhere.
2017-06-15 19:24:07 -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 45446ae21b first round of future awaits (#10760) 2017-06-15 18:49:19 -07:00
xster e56c8850ce Fix simctl race (#10757)
* remove usages of booted

* fix
2017-06-15 18:31:10 -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
Brian Slesinsky d1feb1ad5f Coverage: fix installHook API (#10747)
- remove unused collector parameter
- clarify a comment
- inline _currentPackageTestDir
2017-06-15 14:39:46 -07:00
Chris Bracken 1bc54e0657 Eliminate dead iOS device mock code (#10732)
This code is unused in any test. In upcoming changes that migrate to
Xcode instruments based device listing, we'll mock out the instruments
output separately.
2017-06-15 11:32:39 -07:00
Todd Volkert 747e25e891 Fix devfs directory scanning to not attempt to scan non-existent directories (#10727) 2017-06-15 10:29:42 -07:00
Dan Rubel befe019896 flutter analyze --watch --flutter-repo check package conflicts (#10641) 2017-06-13 20:50:53 -04:00
Brian Slesinsky e329356f0f Oops, fix code coverage (#10672)
And add comments explaining why.
2017-06-13 14:42:09 -07:00
Brian Slesinsky 3528cd6f2d flutter test: add --machine flag (#10520)
Currently this just prints the observatory URL as a JSON event.
Refactored the code to make this fit in.
2017-06-13 13:26:32 -07:00
Todd Volkert 37e32d5aee Switch flutter --version --json to be flutter --version --machine (#10627) 2017-06-12 12:23:13 -07:00
Ian Hickson 0f1a703a6b More documentation (#10589) 2017-06-08 17:13:03 -07:00
Phil Quitslund 95544383ef Bump to Dart SDK 1.24.0-dev.6.7. (#10585)
* Bump to Dart SDK 1.24.0-dev.6.7.

* nits and fixes
2017-06-08 15:15:18 -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
Kevin Moore 1b56cb790c Add --version-json to flutter CLI (#10538)
closes https://github.com/flutter/flutter/issues/10534
2017-06-06 18:40:32 -07:00
Todd Volkert 078b380d51 Remove underscores from Android identifier during flutter create (#10506)
Fixes #10077
2017-06-05 11:25:46 -07:00
Chris Bracken d65b9fb6dc Update tracking bug for SDK spaces in doctor (#10504) 2017-06-05 09:42:45 -07:00
Chris Bracken fe520201b8 Emit doctor error if Flutter SDK path contains spaces (#10477)
Should be reverted when https://github.com/flutter/flutter/issues/6577
is fixed.
2017-06-02 18:49:32 -07:00
xster cb959724cb Small setup doc for the app store option (#10418)
* Small setup doc for the app store option

* review notes
2017-06-02 16:01:20 -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
Devon Carew 15928fbdf7 have app loggers log to their parent logger (#10402)
* have app loggers log to their parent logger

* rename field to parent

* add todo

* revert flutter_tools.iml change

* ping the bots
2017-06-02 15:22:46 -07:00
Gary Qian a367dcb02c Add flags to pass '--enable-software-rendering' flag to engine in run command (#10449) 2017-06-02 09:44:36 -07:00
Chris Bracken 9c502cba95 Clean up ideviceinstaller doctor messages (#10408)
Eliminates nearly-duplicate install instructions for libimobiledevice,
ideviceinstaller.

Since ideviceinstaller depends on libimobiledevice, it's almost certain
that if libimobiledevice isn't installed, or needs updating, so does
ideviceinstaller.
2017-05-31 12:08:45 -07:00
Chris Bracken 479e533b01 Clarify libimobiledevice doctor check message (#10406)
This message will be emitted both when libimobiledevice requires
updating, or when it has not yet been installed.

It's also not specifically the version of Xcode that it's incompatible
with, it's the lockdownd daemon, which is actually more closely tied to
iTunes.
2017-05-31 11:32:26 -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 49cec4593a Apply minor formatting fixes (#10261) 2017-05-22 17:08:49 -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
Michael Goderbauer 9a908f7558 Revert "Partial rollback of #10204" (#10258)
* Revert "Test installation status when ideviceid is not installed (#10254)"

This reverts commit 0e5d4a8771.

* Revert "Partial rollback of #10204 (#10256)"

This reverts commit b291bf5d6a.
2017-05-22 16:06:22 -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
Michael Goderbauer b291bf5d6a Partial rollback of #10204 (#10256)
This broke Fuchsia as they haven't updated to Dart 1.24 yet :(
2017-05-22 13:28:59 -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
Michael Goderbauer d33fd923bf Print locale in flutter doctor (#10204)
This helps to debug encoding issues that are believed to only happen for certain locales (see https://github.com/flutter/flutter/issues/10198 fo example).

DO NOT SUBMIT until Dart SDK has been bumped (https://github.com/flutter/flutter/pull/10110) as this depends on new API.
2017-05-22 10:21:10 -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
Todd Volkert a88379399e Don't fail assert when we send an error to the plugin. (#10207) 2017-05-19 12:34:41 -07:00
Ian Hickson 77d67c9d30 fix flutter analyze --dartdocs (#10182) 2017-05-19 08:46:34 -07:00
Michael Goderbauer fdbb1fbbc7 Add a note about how to edit platform code in IDE to flutter create --plugin (#10189) 2017-05-18 18:18:51 -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
Ian Hickson 73dcca65f7 Nits for protocol discovery (#10112)
Rather than complain about these in a code review I figured I'd just fix them. :-)
2017-05-16 11:38:07 -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 db84df230d Some tools to dump other trees. (#9999) 2017-05-12 15:51:58 -07:00
Ian Hickson 292abf7223 "flutter packages pub ..." to passthrough to dart pub (#10044) 2017-05-12 15:40:35 -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
Devon Carew 2f737cf94e change a printStatus() to a printTrace() (#9992) 2017-05-11 08:49:26 -07:00
Ian Hickson dddf572780 Minor tweaks to flutter doctor (#9963) 2017-05-10 16:28:12 -07:00
Todd Volkert ff7d9432b8 Allow for different adb server version messages in device detection (#9974) 2017-05-10 15:51:08 -07:00
Jason Simmons d1fa21166b Use runCommand to start sdkmanager and adjust the executable name for Windows (#9962)
Fixes https://github.com/flutter/flutter/issues/9954
2017-05-10 12:42:42 -07:00
Jason Simmons d780c4b205 Revert "Gracefully handle !isValid in AndroidStudio.gradleExecutable (#9893)" (#9934)
Fixes https://github.com/flutter/flutter/issues/9929
2017-05-09 13:11:29 -07:00
Todd Volkert a667bf935e Gracefully handle !isValid in AndroidStudio.gradleExecutable (#9893)
Fixes #9866
2017-05-09 10:54:54 -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
Mikkel Nygaard Ravn 76dbfe9a38 Fixed android template (#9917) 2017-05-09 14:41:39 +02:00
Mikkel Nygaard Ravn c1feee93d3 iOS plugin registry (#9818) 2017-05-09 12:00:07 +02:00
Mikkel Nygaard Ravn 24a3e58cd0 Android plugin registry (#9715) 2017-05-09 11:43:19 +02: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
Yegor fa47c34f76 fix version stamp Map check (#9890) 2017-05-08 12:59:33 -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
Michael Goderbauer 6337a0553c Don't crash on flutter create . on Windows (#9850)
* Don't crash on `flutter create .`

Fixes #9828

* review comments
2017-05-05 15:47:13 -07:00
Todd Volkert 2841497344 Support IPv6 in coverage collection (#9841)
Builds on engine fixes to #9813

Also fixes #7366
2017-05-05 11:09:55 -07:00
Jakob Andersen 6b54137a15 Improve Android builds. (#9801)
Eagerly generate local.properties, and always update the flutter.sdk
setting in it, in case FLUTTER_ROOT has changed.

Fixes #8365.
Fixes #9716 - at least the specific issue reported. My Android Studio
still complains about Gradle versions - it ships with v3.2, but requires
v3.3...

Add a 'generate dependencies' task to the Gradle build, which checks if
the snapshot dependencies file exists, and runs an extra build before
the actual FlutterTask if it doesn't. This makes the first build slower,
but sub-sequent builds (without source changes) much faster.

Fixes #9717.
2017-05-05 14:53:51 +02:00
Jason Simmons b7ceed6b9d Handle missing directories in the flutter doctor IntelliJ check (#9812) 2017-05-04 14:48:41 -07:00
xster 837f101056 Let (almost) all flutter create CocoaPods references be dynamically generated later (#9791)
* Remove all initial cocoapod traces from flutter create except Podfile

* Make updateXcodeGeneratedProperties parameters named

* review notes
2017-05-04 12:26:58 -07:00
Ian Hickson e504dabdd2 Minor style tweaks (#9766) 2017-05-04 10:28:17 -07:00
Todd Volkert ba4bba7498 Support IPv6 in test platform (#9795) 2017-05-03 22:50:24 -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 b8b6a14d8b Make a few error messages bold (#9774) 2017-05-03 16:01:04 -07:00
Todd Volkert 3b5b46b07c Revert "Switch test platform to use IPv6 (#9775)" (#9779)
This reverts commit 9f5fa31ebd.
2017-05-03 14:46:28 -07:00
Todd Volkert 9f5fa31ebd Switch test platform to use IPv6 (#9775) 2017-05-03 14:33:38 -07:00
xster 2051669ac7 CocoaPods flow step 2 - don't pod install unless project has plugins (#9741)
* Revert "Revert "Don't try to resolve CocoaPods unless project has plugins" (#9719)"

This reverts commit f739e9e022.

* Remove channels integration test’s partial cocoapods artifacts
2017-05-03 11:19:59 -07:00
xster 87d0010adb Let printError be able to print bold also (#9714)
* Let printError print bold as well

* review notes
2017-05-02 22:20:14 -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
Devon Carew 7fb6646c96 fix an issue with reloading when paused at a breakpoint (#9733)
* fix an issues with reloading when paused at a breakpoint

* update docs
2017-05-02 16:09:57 -07:00
Michael Goderbauer c256e6d557 Populate PUB_ENVIRONMENT for initial pub get and correctly detect APPVEYOR as bot (#9725)
* Populate PUB_ENVIRONMENT for initial pub get

* review comments

* change order
2017-05-02 11:25:59 -07:00
Devon Carew 6957eabe2c tweak the doctor check for host compatibility (#9720) 2017-05-02 10:32:00 -07:00
Ian Hickson f739e9e022 Revert "Don't try to resolve CocoaPods unless project has plugins" (#9719)
* Revert "Document ScrollController (#9705)"

This reverts commit ff8609f273.

* Revert "Fix channels integration test (#9713)"

This reverts commit aace622d3f.

* Revert "Fix flutter view project's automated tests (#9712)"

This reverts commit 1a4bf9b66d.

* Revert "Update hello_world_memory_test package name (#9704)"

This reverts commit ffa8483f3b.

* Revert "Increment the flutter package version (#9699)"

This reverts commit 3b237a8c62.

* Revert "Don’t pod unless there are plugins (#9701)"

This reverts commit 732f79eed7.
2017-05-02 08:57:05 -07:00
xster 732f79eed7 Don’t pod unless there are plugins (#9701) 2017-05-01 13:37:45 -07:00
xster 9a61b8713c CocoaPods flow step 1 (#9687)
* Add cocoapods reason

* s/native/iOS
2017-05-01 12:47:25 -07:00
Todd Volkert 9c1aba2abe Skip adb server restarts during device discovery (#9693) 2017-05-01 10:10:16 -07:00
Devon Carew 6716904385 return the result from calling a service extension (#9636) 2017-04-28 07:39:14 -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
Michael Goderbauer b432af51fd Don't crash when ADB exits with non-zero exit code (#9653) 2017-04-27 14:57:56 -07:00
Todd Volkert ffdca6f7e8 Fix getDevicesById() (#9646)
If the user specified a non-exact device id, it was producing
an exception whereby we were trying to listen to the
`getAllConnectedDevies()` stream twice.
2017-04-27 13:12:59 -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 aaaae265ae Run async when calling adb shell getprop (#9611)
Also, add a timeout so a hung `adb` will not cause the
tools process to hang.

Fixes #9567
2017-04-26 09:58:20 -07:00
Todd Volkert 21f57a85e8 Wait for stderr in runCommandAndStreamOutput() (#9598) 2017-04-25 17:40:28 -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 31828609dc add @required (#9579) 2017-04-25 08:59:43 +02:00
Zachary Anderson 9b250cb6e8 [fuchsia_reload] More information from --list (#9503) 2017-04-20 15:06:56 -07:00
John McCutchan 03d684be6d Fix a race in runFromSource. (#9495)
There is a race where we could complete a future based on a stream event
and then before we cancel the stream subscription, we get another event
and try and complete the future again.
2017-04-20 10:05:30 -07:00
Devon Carew f29dd4f921 improve progress display when running apps; speed up startup (#9475)
* improve progress display when running apps; speed up startup

* review comments
2017-04-20 07:13:35 -07:00
Adam Barth ab1aa07e8f Update engine (#9484) 2017-04-19 15:42:02 -07:00
Devon Carew a97060e095 don't pass in --no-packages-dir (#9476) 2017-04-19 15:26:24 -07:00
John McCutchan 367e11a4a8 Handle reassemble timeouts gracefully. (#9467)
- [x] Switch the reassemble timeout to 5 seconds.
- [x] Print a status message if reassemble fails:

```
Performing hot reload...
Reassembling app.flx$main took too long. Hot reload may have failed.
Reloaded 0 of 418 libraries in 5,322ms.
```

Fixes #9316
Fixes #8861
Fixes #8857
Fixes #8856
2017-04-19 09:30:14 -07:00
John McCutchan 71d80fbd3f Fix hot reload / restart after the back button dismisses the app on Android (#9455)
- [x] Refresh FlutterViews before issuing a hot reload / restart

Fixes #7248
2017-04-18 14:18:33 -07:00
Devon Carew 4631717f1b De-duplicate the dartanalyzer command output (#9441) 2017-04-18 14:02:06 -07:00
John McCutchan 2cf50ce574 Fix hot restart when application is being debugged (#9450)
- [x] Resume the isolate before performing a hot restart.

Fixes #8923
2017-04-18 13:27:53 -07:00
Michael Goderbauer 9a05e984d8 Ask users to set ANDROID_HOME if SDK is installed in a non-standard location (#9445) 2017-04-18 11:56:09 -07:00
John McCutchan acd75c0a3b Improve flutter_tools handling of the device being unplugged while syncing DevFS (#9431)
- [x] Catch SocketErrors and handle them gracefully.
- [x] Print 'Lost connection to device' when the service protocol connection is severed unexpectedly.
- [x] Print 'Application finished' when the application exits otherwise.

After this PR:

```
Launching lib/main.dart on Nexus 7 in debug mode...
Running 'gradle assembleDebug'...                     1.2s
Built build/app/outputs/apk/app-debug.apk (21.7MB).
Syncing files to device...
Application finished.
DevFS sync failed. Lost connection to device: SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 53062
Could not perform initial file synchronization.
```

Fixes #6705
2017-04-17 15:35:01 -07:00
Zachary Anderson b645e4ea3c [fuchsia_reload] Fix command line argument checking (#9434) 2017-04-17 15:21:12 -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
John McCutchan 5e73133797 Use a different message on the first reload. (#9418)
The first hot reload does a bunch of work that we used to hide behind the
loader screen. This PR changes the messsage printed to the user on the first
reload from:

'Performing hot reload...'

to:

'Initializing hot reload...'

Subsequent reloads say 'Performing hot reload...'
2017-04-17 11:03:43 -07:00
Brian Slesinsky cc3b91479c flutter create: don't use relative paths in IDEA config files (#9414)
When invoked from the command line, relative paths aren't typically
used, but they are when invoked from within IDEA and prevents
IDEA from reading the files.

Also, remove flutterPackagesDirectory since it's not used
2017-04-16 13:58:08 -07:00
Zachary Anderson a0369806f2 [fuchsia_reload] Give more information in the module list (#9400) 2017-04-14 21:18:48 -07:00
Zachary Anderson 9fdd4f4701 [fuchsia_reload] Reload each instance of a module. (#9379) 2017-04-14 11:33:47 -07:00
Brian Slesinsky 5cb9097965 flutter create: enable Java support in IDEA (#9335)
Generates an android.iml file and a package-level library for flutter.jar.

Does not set up an Android SDK in IDEA; this isn't possible with a
template-based approach. But IDEA shows a clear warning, so the
user can fix this by setting the SDK.

(When creating a Flutter project from within IDEA, we can fix this up
afterwards in the plugin.)
2017-04-14 10:12:48 -07:00
Jason Simmons 9455fb64d9 Allow upgrades and version checks against the alpha branch (#9387)
Fixes https://github.com/flutter/flutter/issues/9258
2017-04-14 09:58:31 -07:00
Jason Simmons 76bebeed9d Instruct users to run Android Studio so it will install Android SDK components (#9323)
Fixes https://github.com/flutter/flutter/issues/8690
2017-04-13 11:28:18 -07:00
Ian Hickson 2a54524337 Fix tests to use Ahem, and helpful changes around that (#9332)
* Fix tests to use Ahem, and helpful changes around that

- Fix fonts that had metric-specific behaviours.

- LiveTestWidgetsFlutterBinding.allowAllFrames has been renamed
  to LiveTestWidgetsFlutterBinding.framePolicy.

- LiveTestWidgetsFlutterBinding now defaults to using a frame policy
  that pumps slightly more frames, to animate the pointer crosshairs.

- Added "flutter run --use-test-fonts" to enable Ahem on devices.

- Changed how idle() works to be more effective in live mode.

- Display the test name in live mode (unless ahem fonts are enabled).

- Added a toString to TextSelectionPoint.

- Style nit fixes.

* Roll engine to get Ahem changes.

* Update tests for dartdoc changes.

* Fix flutter_tools tests
2017-04-12 13:33:02 -07:00
Devon Carew 20e83e3e58 change the reload success message to include both the elapsed time and the library count (#9328) 2017-04-11 07:57:18 -07:00
Yegor a5593b1678 fix analyzer warning: use const where possible (#9320) 2017-04-10 14:20:47 -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
Jakob Andersen 7ffa82aaf0 Inject plugin registration. (#9216)
Added a PluginRegistry to the new project template. The registry files will be automatically updated at build time to register the native plugins.

Fixes #7814.
2017-04-10 15:44:19 +02:00
Devon Carew 70e2acfb6c tweak the layout for the ios doctor checks (#9306) 2017-04-09 12:43:48 -07:00
Devon Carew ca5f0c9a3e fix the return type on flutterPlatformOverride (#9269) 2017-04-09 11:08:32 -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
Jason Simmons 8ee6525cc8 Remove the obsolete build apk --target-arch flag (#9239)
Gradle APK builds include engine binaries for all applicable architectures
2017-04-07 13:48:10 -07:00
Jason Simmons 67b3871e2a Filter Android logs by the pid of the remote process (#9293)
Fixes https://github.com/flutter/flutter/issues/6849
2017-04-07 13:41:29 -07:00
Alexandre Ardhuin 8bcf302e23 use conditional assignment (#9252) 2017-04-07 21:41:17 +02:00
Ian Hickson 3eb87830e9 Constants! Constants everywhere! (#9286)
Aggressively apply the const lint.
2017-04-07 12:24:32 -07:00
Ian Hickson 6d5488ad3e Minor fixes to flutter packages. (#9278) 2017-04-07 12:23:57 -07:00
Ryan Macnak 249bbac362 Support for placing an AOT dylib in the flx. Part of Fuchsia AOT sup… (#9240)
Support for placing an AOT dylib in the flx.  Part of Fuchsia AOT support.
2017-04-06 11:12:12 -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
Ian Hickson a52c7b470d Update the examples/ README and associated fixes. (#9090)
This yak shave went as follows:

Fix https://github.com/flutter/flutter/issues/8795 by adding stocks to
the examples README.

Notice the layers entry in that README isn't quite right either.
Update that.

Check the layers/README file is worth pointing at.

Update the layers/README.

Let's run some of the layer tests to see if they still work.

Oops, need to update them to gradle.

Ok let's try running them again.

Oops, sector is broken.

Add a test for sector.

Fix sector. Find you need to add an assert to a const constructor.

Notice we need to turn const asserts on for the analyzer.

Notice the analysis_options files are out of sync with each other and
with the full list of lints.

Turn on the lints that should be on.

Fix the bugs that finds.
2017-04-05 11:28:33 -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
Dwayne Slater eb9046b175 [Flutter Tool] Only uninstall Android app when the initial install fails (#8930)
Uninstalling the app removes the data and cache directories, so this
allows application data to persist across multiple flutter run
invocations.

This also handles the edge case where the app fails to install due to an
error in installation (e.g. debug keystore changes, switching from a
release keystore to a debug keystore, etc.).
2017-04-04 10:16:42 -07:00
Todd Volkert dbc447b19a Only complete the web socket future once (#9176) 2017-04-04 10:15:48 -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 91dbb3c91e roll engine and update tools for the removal of dart:jni (#9137) 2017-03-31 16:20:14 -07:00
Chris Bracken a54979e1fe iOS: fail build wth error if Python six missing (#9135)
Xcode builds depend on the Python 'six' module. If not present, exit
immediately with a useful error message.

The six module is included in the system default Python installation. We
perform this check in case a custom Python install has higher priority
on $PATH; e.g., due to a Homebrew or MacPorts installation.

This extracts an existing doctor check to use it during the build step
as well.
2017-03-31 14:40:22 -07:00
Alexandre Ardhuin 2de61a0853 add @required when there's an assert not null (#9124)
* add @required when there's an assert not null

* address review comments
2017-03-31 18:34:13 +02:00
John McCutchan 0ee7fabe9a Improve verbose trace output (#9104)
Related #8876
2017-03-30 10:03:42 -07:00
Jakob Andersen f34f8a3197 Add template for plugin projects. (#9076)
Plugin projects are created by running `flutter create --plugin <name>`.

An example app is also created in the plugin project, using the normal 'create' template, which has been modified to allow for conditional plugin code.

Modified the android package name to match package naming conventions (all lower-case, and must match the directory name).
2017-03-30 12:39:21 +02:00
Jason Simmons e7f1361681 Update artifact names and remove obsolete artifacts (#9091) 2017-03-29 16:30:41 -07:00
Yegor e067041279 increase vmservice timeout; log stderr in microbenchmarks (#9088) 2017-03-29 15:40:17 -07:00
Jason Simmons 72effdd27c Roll the engine and update for new binary names (#9089) 2017-03-29 15:31:36 -07:00
Alexandre Ardhuin 4c530d5e8c prefer_final_fields (#8967) 2017-03-29 21:21:46 +02:00
John McCutchan 7483bc153d Stop handling signals and terminal input separately (#9057)
Fixes #7307
2017-03-29 06:46:27 -07:00
Ian Hickson 0b566b3850 Improve output of flutter doctor on iOS (#8959) 2017-03-28 17:16:37 -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
Phil Quitslund ab6df3af40 Bump to Dart SDK 1.23.0-dev.10 (#9051)
* Bump to Dart SDK 1.23.0-dev.10

* allows us to understand flutter usage via telemetry
* brings in `@immutable`

Fixes: #9042

* completer fix

* Update to platform 1.1.1.
2017-03-28 14:53:03 -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
Jakob Andersen eedc5d9f58 Make pod install a long-running step. (#8999)
The very first time `pod install` is invoked, CocoaPods downloads the master spec repository, which takes quite a while. Before this change, the build appeared to have stalled. With this change, at least the spinner is moving.

Added `pod setup` to the install instructions for CocoaPods, so the spec repo is downloaded while setting up Flutter, instead of during the first build.
2017-03-27 09:30:36 +02:00
Michael Goderbauer 06144a7207 Fix crash when old Android Studio (<2.2.0) is installed (#9009)
Old Android Stuio versions pior to 2.2.0 didn't come with Java bundled. Make sure flutter doesn't crash when we try to determine the Java version of those old Android Studio installations.
2017-03-24 17:07:08 -07:00
Chris Bracken 25999678fd Use const for string literals where possible (#8980) 2017-03-23 11:41:03 -07:00
xster 3bc3d4a50b Remove various roboto font logic (#8350) 2017-03-23 11:28:03 -07:00
Michael Goderbauer 41edc1ac74 Use Java bundled with Android Studio for gradle (#8965)
* Use Java bundled with Android Studio for gradle

* review comments
2017-03-23 10:17:24 -07:00
P.Y. Laligand d356b2d77a Generate a depfile for assets of a flutter_app. (#8961) 2017-03-23 09:42:58 -07:00
Jakob Andersen b61e169011 Automatically wire dependencies for native plugins (#8891)
Go through all packages brought in by pub, and write the name and path of every one that is a flutter plugin into .flutter-plugins.

In android/settings.gradle and ios/Podfile, read in .flutter-plugins, if that file exists. The Android / iOS code from the plugins is automatically added as dependencies of the native code of the app.
2017-03-23 14:59:12 +01:00
Chris Bracken 0ee3f57a10 Build Flutter app as a framework on iOS (#8971)
**THIS IS A BREAKING CHANGE.** See below for migration steps for
existing projects.

Previously, Flutter app code was built as a raw dylib on iOS.  Dynamic
libraries outside of a framework bundle are not supported on iOS, except
for the system Swift libraries provided by Xcode.

See:
https://developer.apple.com/library/content/technotes/tn2435/_index.html#//apple_ref/doc/uid/DTS40017543-CH1-TROUBLESHOOTING_BUNDLE_ERRORS-EMBEDDED__DYLIB_FILES

* Migrates Xcode build from app.dylib to App.framework
* Migrates flutter create template
* Migrates example projects

Migration steps for existing projects
=====================================

The following steps should be taken from the root of your Flutter
project:

1. Edit `ios/.gitignore`: add `/Flutter/App.framework` on a new line.
2. In the Xcode project navigator, remove `app.dylib` from the Flutter
   folder. Delete this file from the `ios/Flutter` directory in your project.
3. Run a build to generate `ios/Flutter/App.framework`. From the command
   line, run `flutter build ios`. If you have not configured app signing
   in Xcode, an alternative method is to open the simulator, then run
   `flutter run -d iP`.
4. In the Xcode project navigator, select the `Runner` project. In the
   project settings that are displayed in the main view, ensure that the
   `Runner` target is selected. You can verify this by exposing the
   sidebar using the [| ] icon in the upper-left corner of the main
   view.
5. Select the *General* tab in the project settings. Under the
   *Embedded Binaries* section, click '+' to add `App.framework`. In the
   sheet that drops down, click the *Add Other...* button. Navigate to
   the `ios/Flutter` directory and select `App.framework`. Click *Open*.
   In the sheet that drops down, select *Create folder references*, then
   click *Finish*.
6. In the project settings, verify that `App.framework` has been added to the
   *Embedded Binaries* and *Linked Frameworks and Libraries* lists.
7. In the Xcode project navigator, drag `App.framework` under the
   Flutter folder.
8. In the Xcode project navigator, select `Flutter` then from the
   *File* menu, select *Add Files to "Runner"...*. Navigate to the
   `ios/Flutter` directory, select `AppFrameworkInfo.plist` and click
   the *Add* button.
9. From the command line, in your project directory, run
   `flutter build clean`, then `flutter run`.

At this point your project should be fully migrated.
2017-03-22 17:41:49 -07:00
Kevin Moore 358e1cd2e1 Teach flutter_tools to populate PUB_ENVIRONMENT (#8962)
* Teach flutter_tools to populate PUB_ENVIRONMENT

Will allow telemetry reporting on pub.dartlang.org once
flutter moves to 1.23.0-dev.10.0

* review changes
2017-03-22 13:25:38 -07:00
Michael Goderbauer 3f4cb1fe8c Report detailed OS version string to analytics (#8934) 2017-03-22 13:11:05 -07:00
Michael Goderbauer 1bae8a0365 Print error message if a package is skipped during DevFS sync. (#8960)
* Print error message if a package is skipped during DevFS sync.

* review comments

* more review comments

* fix test
2017-03-22 13:04:34 -07:00
Michael Goderbauer e01e4c18e1 Fix various gradle paths for Windows (#8935) 2017-03-22 12:31:53 -07:00
Jakob Andersen f12e382575 Add more logging to diagnose test failures. (#8951) 2017-03-22 14:50:17 +01: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
Alexandre Ardhuin fac2fac1d6 add missing const keyword (#8931) 2017-03-21 21:07:36 +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
Michael Goderbauer 9056ded298 remove work around for https://github.com/dart-lang/sdk/issues/28599 (#8865) 2017-03-20 10:30:30 -07:00
Jakob Andersen 7b2367ed5f Remove legacy .apk build. (#8793)
* Remove legacy .apk build.

Print out an error message telling the user to upgrade the project if
it's not Gradle-based. Removed all the obvious traces of the legacy
build.

Added support for Dart VM kernel snapshots in Gradle builds.

Fixed Android installs to verify that the app is actually installed, and
not just rely on the presence of the .sha1 file.
2017-03-20 11:05:55 +01:00
Zachary Anderson 87334eb424 [fuchsia_reload] Add flag to override on-device binary name (#8873) 2017-03-18 21:34:01 -07:00
Jason Simmons 808cd092a0 Handle malformed UTF-8 in logcat streams (#8864) 2017-03-17 15:32:59 -07:00
Jakob Andersen 3d3900871a Make sure local.properties file is created before calling gradle. (#8847)
Fixes #8821
2017-03-17 09:13:58 +01:00
Alexandre Ardhuin a0769f2488 apply the upcoming rule unnecessary_this (#8838) 2017-03-17 08:05:42 +01:00
Michael Goderbauer c9a9c627b6 Remove nasty ANSI workaround for Windows (#8839)
The problem has been fixed upstream in the Dart VM.

This simplifies our setup instructions on Windows (will update the wiki).
Furthermore, this also means that going forward there is no diffrence between PowerShell and Cmd for the Flutter experience on Windows.
2017-03-16 18:04:14 -07:00
Michael Goderbauer 2291a56842 Remove support for function keys. (#8840)
Function keys don't work great on any platform we support:
* Mac doesn't have first-class function keys.
* On Ubuntu: F1 opens the system help and F10 opens the file dialog.
* ... and Windows is a mess as well.
2017-03-16 18:00:21 -07:00
Michael Goderbauer 0550c2f021 Remove workaround for SIGINT (#8834)
It's no longer needed with the latest Dart SDK roll.
2017-03-16 15:10:20 -07:00
Zachary Anderson 9a068c65e4 [fuchsia_reload] Find and attach to the first instance of the named app (#8830) 2017-03-16 14:35:53 -07:00
Jakob Andersen cefcd249ac Only run pod install if CocoaPods v1.0.0 or greater is installed. (#8790)
* Only run pod install if CocoaPods v1.0.0 or greater is installed.

Avoid issues with older versions of CocoaPods breaking the build. Users who genuinely use older versions of CocoaPods will have to run pod install manually when required.
2017-03-16 11:19:07 +01:00
Michael Goderbauer d87f19817f devicelab benchmarks run on Windows (#8814)
* devicelab benchmarks run on Windows

* fix analyzer issue

* fix test

* fix pubspec
2017-03-15 16:33:10 -07:00
John McCutchan 4c91b6e725 Stop using package:stack_trace and Chain.capture (#8803)
- [x] Don't use package:stack_trace.
- [x] Don't use Chain.capture.
- [x] Fix an instance of aggressive catching of exceptions

Related #8742
2017-03-15 15:39:01 -07:00
John McCutchan a80e5c20f3 Add a doctor check for host executable compatibility (#8798)
Fixes #6207
2017-03-15 15:22:54 -07:00
Alexandre Ardhuin 2166ea5b7f apply partially the upcoming unnecessary_lambdas (#8810) 2017-03-15 23:09:58 +01:00
Todd Volkert 12ebb66d9e Allow FlutterVersion to be overridden in the context (#8801) 2017-03-15 14:01:45 -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
Alexandre Ardhuin a9ba0e2f88 prefer_initializing_formals (#8797) 2017-03-15 18:30:55 +01:00
John McCutchan 7843afd4d6 Tweak reload finished message (#8792) 2017-03-15 07:08:42 -07:00
Jakob Andersen 1457f3dbb0 Put Gradle output in build/ (#8759)
Changed the default build output directory in the new project template
to build/, instead of android/build/ and android/app/build/.

Updated tools to ask the Gradle scripts what the build directory is,
since this is configurable in the build scripts, and we need to know
where the build output actually is.

Silenced output from 'flutter build aot' when invoked from Gradle, since
the output was confusing in this case.

Fixes #8723
Fixes #8656
Fixes #8138
2017-03-15 10:53:22 +01:00
Chris Bracken bd15e8dd76 Emit macOS version information in doctor (#8772)
macOS counterpart to c670cd9e64.
2017-03-14 12:11:09 -07:00
Michael Goderbauer c670cd9e64 add windows version to flutter doctor (#8771) 2017-03-14 11:42:52 -07:00
Zachary Anderson b6ba37d768 Adds initial support for hot reload for Fuchsia to flutter_tool. (#8764) 2017-03-14 11:12:19 -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
Jason Simmons e44f513e43 Fix the gen_snapshot path for a local_engine FLX build in debug mode (#8754)
gen_snapshot is now used for both JIT and AOT snapshots.  The JIT version
used in debug mode will be a 64-bit binary.
2017-03-14 10:17:59 -07:00
John McCutchan 2148e9aff6 Improvements to flutter doctor JDK search. (#8745)
- [x] Add custom logic on MacOS to determine if Java is installed before invoking `java`.
- [x] Check JAVA_HOME, platform specific logic, and finally PATH to locate the `java` executable.
- [x] Improved doctor messages.

Fixes #8508
Fixes #8521
2017-03-14 09:57:34 -07:00
Jakob Andersen 9c6ffc8281 Use snapshot's .d file as source inputs in Gradle build. (#8756)
* Use snapshot's .d file as source inputs in Gradle build.

If we don't yet have a .d file (first build), fall back to using the
.dart files in the current directory. This enables us to detect changes
in dependent source files (Flutter framework, packages outside the
source directory, etc.), and re-generate the snapshots as needed.

Unfortunately, Gradle requires knowing the source files before executing
the task, and can't update them after building, so Gradle considers the
second build to be out-of-date (because it has more input files than the
first build). Sub-sequent builds have the correct dependency
information, and will be skipped if the source files haven't changed.

Also added a dependency on gen_snapshot. The snapshot ABI isn't stable,
so we need to re-generate the snapshots when we roll the Dart SDK
dependency.

Fixes #8315
Fixes #8687
Fixes #8607
2017-03-14 12:49:30 +01: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
Dan Rubel b10e60bc15 do not forward errors if stream is closed (#8739) 2017-03-13 15:07:13 -04:00
John McCutchan 31dc3c4722 Try all possible Android SDK locations before giving up (#8730)
Fixes #8618
2017-03-13 11:21:34 -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
Yegor 9f020d6104 upgrade package:http so we no longer need custom MultipartRequest (#8715) 2017-03-10 11:05:06 -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
Jakob Andersen 60c0c3d323 Revert "Eliminate CocoaPods install step (#8694)" (#8705)
* Revert "Eliminate CocoaPods install step (#8694)"

This reverts commit f4a13bc72b.

If the developer is relying on CocoaPods and hasn't done a pod install, we will do it for them. This is needed for a smooth native plugin experience, similar to what Gradle is doing on the Android side.

There's no hard dependency on CocoaPods. We only run pod install if the project uses CocoaPods, so developers are still free to use alternatives if they prefer (and if they don't want to use native plugins).

Fixes #8685
Fixes #8657
Fixes #8526

* Require CocoaPods 1.0.0 or newer.

And make sure we don't get a crash if running `pod install` fails.

* Address review feedback
2017-03-10 13:43:57 +01:00
Alexandre Ardhuin c22812e0ea Flutter style guide: Prefer naming the argument to a setter 'value' (#8691) 2017-03-10 09:00:29 +01:00
Chris Bracken 7b9cefb3be Add brew update step before install/upgrade (#8703)
This avoids unintentionally installing an older version if the
developer's homebrew installation is out-of-date.
2017-03-09 20:45:40 -08:00
Chris Bracken 1bb0d7728e Eliminate brew tap flutter/flutter instruction (#8702)
The flutter tap was deleted as part of the resolution to #7783.
2017-03-09 18:26:38 -08:00
Chris Bracken f4a13bc72b Eliminate CocoaPods install step (#8694)
If the developer is relying on CocoaPods and hasn't done a pod install,
they'll get a build failure indicating the issue.

This also avoids a hard dependency on CocoaPods in the tool and allows
developers to customize their Xcode steps to use alternatives such as
Carthage if they prefer.
2017-03-09 17:57:45 -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
Michael Goderbauer edbfb17b62 remove remaining references to sky_snapshot (#8665) 2017-03-09 11:40:59 -08:00
Chris Bracken cabd58dbb2 Correct instructions for libimobiledevice install (#8675)
As of the latest Xcode versions, the latest published libimobiledevice
is out-of-date and build from HEAD is required.

This fixes two bugs:
1. Update initial install instructions to add --HEAD flag.
2. Update uninstall, reinstall instructions to include
   --ignore-dependencies flag, since other brew formulae depend on
   libimobiledevice.
2017-03-08 21:24:00 -08:00
Chris Bracken bf6b6e188d Check for CocoaPods installation if required (#8666) 2017-03-08 16:42:31 -08:00
Chris Bracken 2bbdacce35 Improve ideviceinstaller error message (#8662)
Homebrew is an expected part of the iOS toolchain. Update the error
message to assume that.
2017-03-08 15:31:32 -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 329e52c02c apply upcoming rule use_collection_literals_when_possible (#8649) 2017-03-08 14:57:31 -08:00
Michael Goderbauer 906103dd10 eliminate sky snapshot (#8631)
* eliminate sky snapshot

* roll engine
2017-03-08 13:33:06 -08:00
Chris Bracken eb14385297 Update CocoaPods install instructions to use Homebrew (#8644)
This is consistent with the rest of the iOS toolchain.
2017-03-07 21:52:40 -08:00
Jakob Andersen a4883de38f Run 'pod install' before building iOS app. (#8609)
Since iOS builds are CocoaPods enabled by default, we should make sure to run `pod install` to get pods wired up before building the app.

Also added a check to `flutter doctor` to verify CocoaPods is installed.

I'm passing FLUTTER_FRAMEWORK_DIR to the `pod install` command, so we can have the app's Podfile link in Flutter.framework as a pod instead of having to copy it over in xcode_backend.sh.
2017-03-07 20:34:38 -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 902ffa1262 Set Cache.flutterRoot after replay environment is set up. (#8614)
Fixes #8562
2017-03-07 11:19:56 -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 aac8762a7a Properly handle ProcessExit being thrown when exit() is called (#8592) 2017-03-06 13:23:03 -08:00
Todd Volkert 011a9026e4 Create and use a STILL_RECORDING shutdown stage (#8588) 2017-03-06 12:02:24 -08:00
Todd Volkert b7f00a643d Defensively handle case of VMservice message that has no id. (#8587) 2017-03-06 11:40:14 -08:00
Michael Goderbauer d5b502bbc2 use new --print-deps option (#8577) 2017-03-06 10:55:32 -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 bb1dea7440 change messaging around Windows (#8549) 2017-03-02 20:06:23 -08:00
Michael Goderbauer e4f586d239 Enable Hot Restart on Windows (#8548) 2017-03-02 20:05:47 -08:00
Michael Goderbauer ae1a719e03 fix FLUTTER_ANSI_TERMINAL check (#8544)
* fix FLUTTER_ANSI_TERMINAL check

should have been included in the previous PR :(

* review comments
2017-03-02 16:25:33 -08:00
Michael Goderbauer 1f7b8ae11f Enable ANSI codes in PowerShell (#8537) 2017-03-02 13:09:36 -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
Jakob Andersen c9644a49f2 Read package ID and activity name from .apk for Gradle-based builds. (#8452)
The gradle build scripts can be configured to output different
application IDs for different build types, so we need to examine the
built .apk to figure out the name of the package and activity.

Re-landing this change, updated to only get information from the .apk
if it exists.

Since the tools create an AndroidApk instance early, even before we've
actually built an .apk, we have to create a new instance after building,
so we can start the right app/activity.

Fixes #8327.
2017-03-02 09:21:40 +01:00
Alexandre Ardhuin 69b6bb87d1 prefer_is_empty and prefer_is_not_empty (#8474) 2017-03-01 22:17:30 -08:00
Michael Goderbauer 99ca38e988 make use of Dart's new capability to print Unicode on Windows (#8505) 2017-03-01 13:15:48 -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
Jakob Andersen 41d81132f9 Don't print stacktraces from ToolExit errors during flutter run. (#8453)
Instead, actually exit the tool.

Fixes #8363.
2017-03-01 13:15:31 +01: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
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
Michael Thomsen 601b800325 Add solution to gradle-dir doctor warning (#8458)
* Add solution to gradle-dir doctor warning

* Review feedback + properly format strings
2017-02-28 16:01:23 +01:00
Jakob Andersen 81a7fb48dd Catch file system exception while looking for Android Studio on macOS. (#8457)
Fixes #8395.
2017-02-28 15:57:47 +01:00
Todd Volkert 0324923119 Add courtesy notice about bug reports containing sensitive info (#8447) 2017-02-28 06:54:04 -08:00
Devon Carew e85d3792f0 fix a doctor check for webstorm (#8450)
* fix a doctor check for webstorm

* fix a missing reference
2017-02-28 06:27:30 -08:00
Michael Goderbauer 9a9a3ffd11 Fix flutter logs on Windows (#8442) 2017-02-27 18:01:21 -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 e7bde11cc3 Simplify path handling logic in dependency checker and devFS (#8414)
* Simplify path handling logic in dependency checker and devFS

Simplification will make it easier to port this to Windows.

* Roll Engine to 0a7b177c330367904597a6129b3eb653d29dfca0
2017-02-27 11:01:14 -08:00
Devon Carew adf3b90df2 check installed IDES for webstorm (#8422) 2017-02-27 07:53:41 -08:00
Chris Bracken 6b97757b6d Ensure packages up-to-date on iOS build (#8412)
iOS builds rely on package dependencies and associated build artifacts
(pubspec.lock, .packages files) to be up-to-date.
2017-02-24 17:47:29 -08:00
Adam Barth a1d36f6892 Revert "Read package ID and activity name from .apk for Gradle-based builds." (#8400) 2017-02-24 11:23:14 -08:00
Jakob Andersen a0c3aae16d Read package ID and activity name from .apk for Gradle-based builds. (#8393)
The gradle build scripts can be configured to output different
application IDs for different build types, so we need to examine the
built .apk to figure out the name of the package and activity.

Fixes #8327
2017-02-24 16:30:59 +01:00
Jakob Andersen 7f9a53b136 Relax Android Studio version check. (#8389)
It's not just $HOME/.AndroidStudio2.2, it might also be
.AndroidStudioPreview2.3, or .AndroidStudioFooBar1.7, or whatever.

Made the Version parser less throw-happy, and relaxed the directory name
checks to allow for the above.

Fixes #8353.
2017-02-24 11:59:59 +01:00
Michael Goderbauer 718859ad8d Partially revert #8332 (#8386)
The JDK doesn't put `javac` in the PATH on Windows :(
2017-02-23 17:35:20 -08:00
Alexandre Ardhuin 8c043d06de fix lints for directives_ordering rule (#8382) 2017-02-23 13:37:26 -08:00
xster 2b61e21b29 Change doc references from .xcodeproj to xcworkspace (#8379) 2017-02-23 12:40:23 -08:00
Todd Volkert a68c979b73 Add ability to record & replay VMService connection (#8355) 2017-02-23 10:05:00 -08:00
Jakob Andersen 6d66be17b9 Add support for target file in Gradle builds. (#8364)
If a target file is specified on the flutter tools command line, pass it
through to Gradle.

It is still possible to statically specify a target file in the flutter
section of build.gradle, but it is now possible to specify it on the
command line as well. The command line option takes precedence.

Fixes #8175.
2017-02-23 15:09:05 +01:00
Jakob Andersen 13d7770cf9 Fix local engine support for Gradle builds. (#8362)
Fixes #6761.
2017-02-23 14:56:19 +01:00
Devon Carew fa04321604 filter an ios simulator assert (#8357) 2017-02-22 20:55:08 -08:00
Michael Goderbauer 28a2b99989 only request sky_snapshot if it is actually needed (#8340) 2017-02-22 13:55:58 -08:00
Michael Goderbauer 99ae5a897e Add line about Java version back to flutter doctor (#8332)
Line was accidentally removed by #8320

Also, change the version check from `java` to `javac` since we need the JDK and not just the JRE.
2017-02-22 13:01:53 -08:00
Jakob Andersen a745fd58be Don't reinstall the app if the latest build is already installed. (#8328)
Only implemented for Android devices for now. Compare the installed SHA1
to the latest build. If they match, there's no reason to reinstall the
build.

Fixes #8295
2017-02-22 14:35:49 +01:00
Jakob Andersen 3676ffe477 Fix bug parsing Gradle version. (#8326)
* Fix bug parsing Gradle version.

Version from pub_semver requires versions of the format X.Y.Z. Gradle
doesn't follow semantic versioning, though, so version parsing would
fail on versions like '3.2'. Fixed by writing a custom Version class.

Also removed a check for apksigner when building Gradle-based projects.

Fixes #8298
2017-02-22 11:53:32 +01:00
Michael Goderbauer 7db8241a6d Revert "Revert "Replace jarsigner with apksigner" (#8164)" (#8320)
This reverts commit 70d7fe3a0d.

The Java version missmatch on the bots has been resolved.
2017-02-21 16:26:30 -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
Chris Bracken 58898636cc Only attempt to deploy to USB-connected iOS devices (#8309)
Do not attempt to deploy/debug wifi connected iOS devices. ios-deploy is
able to install over wifi, but we've had several bugs reporting failure
to run/debug once installation has completed when the device is also
connected via USB. Note that we don't currently support deploy/debug
over wifi since libimobiledevice (which is also required) requires a USB
connection.
2017-02-21 13:02:50 -08:00
Jakob Andersen 421258baea Remove SHA1 check from AndroidDevice.isAppInstalled() (#8290)
* Remove SHA1 check from AndroidDevice.isAppInstalled()

The docs for isAppInstalled say 'check if a version of the given app is
already installed', however the current code returns true only if it's
the latest build that's installed.

This made sense in the past, when the use pattern was:

  if (!isAppInstalled(...)) installApp(...);

but now the usage is:

  if (isAppInstalled(...)) uninstallApp(...);
  installApp(...);

This has the probably unintended consequence that if you run `flutter
install` or `flutter run` two times in a row with no source changes, the
second invocation will uninstall the app, but the first invocation might
not.

Removing the SHA1 check makes us always uninstall the app if it's
installed.

Fixes #8172
2017-02-21 10:18:12 +01:00
Alexandre Ardhuin 2888139c6b prefer const constructor (#8292) 2017-02-20 14:07:16 -08:00
Jakob Andersen 8b820ccc54 One more fix for finding Android Studio on macOS. (#8288)
Finally found the command to run tests in checked mode on my system. This one should've been caught by the IDE, but wasn't.
2017-02-20 14:27:03 +01:00
Jakob Andersen 0f3cc6e943 Fix finding Android Studio on macOS. (#8287) 2017-02-20 13:19:22 +01: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
Ian Hickson f9c2d7d9aa Introduce a quick way to test across platforms (#8262) 2017-02-17 17:47:49 -08:00
Michael Goderbauer e2ff674f31 add windows binaries to allPlatforms (#8250) 2017-02-17 13:40:56 -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
Michael Goderbauer a55a745c73 Fail tests with an actionable message when FLUTTER_ROOT is not set (#8236)
Also: Fix some analyzer warnings.
2017-02-16 18:50:28 -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
Todd Volkert b59982eccd Properly await future when starting app in daemon mode (#8227)
Fixes #8209
2017-02-16 16:46:38 -08:00
Ryan Macnak 9ec5330f32 Roll engine to ab0953092743319e0dde3a0c8f582d261c232964. (#8223)
Update stack_trace_test.dart for changes to the naming of async body functions.
2017-02-16 16:13:17 -08:00
Michael Goderbauer e9af570f1f Enable Gradle Workflow on Windows (#8201)
* Enable Gradle Workflow on Windows

With this the app created by `flutter create` now compiles on Windows.

* Move OS check to gradle file
2017-02-16 14:17:09 -08:00
Jakob Andersen 83b9142468 Fix getMissingPackageHintForPlatform for Gradle-based projects. (#8214) 2017-02-16 13:37:53 -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
Ian Hickson 03ae2cf366 Catch crashes during or before coverage collection. (#8207)
This assumes a fix to https://github.com/dart-lang/test/issues/542

The timeout added in this patch is a workaround for https://github.com/dart-lang/coverage/issues/165
2017-02-15 18:50:19 -08:00
Dan Rubel 7138541d23 new --kernel option for flutter run to use precompiled kernel code (#8191) 2017-02-15 17:37:00 -05:00
Michael Goderbauer 071efec271 Implements WindowsStdoutLogger (#8189)
Replaces unprintable characters with alternative symbols.
2017-02-15 13:20:17 -08:00
Chris Bracken 0dd89fa994 Improve doctor message when xcode-select invocation required (#8179)
If a developer has installed the Xcode command-line tools, then later
installs Xcode, they may need to run xcode-select to update the path of
the command-line tools to that of the new installation.
2017-02-15 10:13:38 -08:00
Todd Volkert d6f61b9ece Add ability to mock VMService's WebSocket connection (#8145) 2017-02-15 06:52:28 -08:00
Michael Goderbauer 70d7fe3a0d Revert "Replace jarsigner with apksigner" (#8164) 2017-02-14 18:02:33 -08:00
Michael Goderbauer b38a6cbbba Replace jarsigner with apksigner (#8154) 2017-02-14 17:11:24 -08:00
Michael Goderbauer 7231fd3ed6 Enable flutter drive on Windows (#8146)
... and run some more tests on Windows.
2017-02-14 13:14:52 -08:00
Todd Volkert f903a1c841 Add retry writing to DevFS. (#8142)
This is a workaround to #8141
2017-02-14 09:59:43 -08:00
Chris Bracken 43650e93f4 Emit additional Xcode settings in flutter create (#8125)
On flutter run, we update ios/Flutter/Generated.xcconfig with various
Flutter-specific settings required by xcode_backend.sh during a build
from Xcode. These settings need to be present at the time the project is
loaded since Xcode doesn't pick up live updates to these files.

Without these settings, Xcode fails to locate xcode_backend.sh itself,
causing the build to fail until the Xcode project has been closed and
re-opened. This also prevents Xcode's project updater from 'helpfully'
suggesting to clean up and delete the Generated.xcconfig file.
2017-02-14 09:56:57 -08:00
Jakob Andersen cd3fd475d8 Don't update Android SDK settings in build.gradle (#8089) 2017-02-14 13:48:14 +00:00
Michael Goderbauer 5e54fd54d9 Ban package:path from Flutter Tools (#8119) 2017-02-13 17:45:50 -08:00
Yegor d4550fd498 do not build APK twice (#8105) 2017-02-13 14:55:35 -08:00
Todd Volkert 9c05c345c7 Enable record/replay of file system activity and platform metadata (#8104) 2017-02-13 13:59:29 -08:00
Dan Rubel ea74e07689 move flutter user analysis options file (#8091)
* move flutter user analysis options file
* add comments referencing each of the analysis options files
2017-02-13 16:39:35 -05:00
Todd Volkert 3b52c87da6 Bump deps on package:file and package:process (#8097) 2017-02-13 09:55:54 -08:00
Michael Goderbauer cff7dc5444 Bump package:process version (#8073) 2017-02-10 16:54:51 -08:00
Chris Bracken 67462b4355 Update IntelliJ plugins link (#8068)
Replace version-specific link with a version-independent URL.
2017-02-10 14:21:37 -08:00
Jason Simmons 198d293857 Support some new Dart features in AOT mode (#8067)
See https://github.com/flutter/flutter/issues/7579
2017-02-10 13:14:57 -08:00
Devon Carew 5caeb3ff32 use the intl package (#8060) 2017-02-10 09:36:04 -08:00
Jakob Andersen b246c5e7e9 Make new project template gradle-based for Android. (#7902)
* Make new project template gradle-based for Android.

With this change, the 'new project' template uses the same gradle-based build for Android as the hello_services example. This has some implications on build performance, since we're now building a complete Android app instead of just combining a pre-compiled .dex with the Flutter assets.

The very first build is a little over 2x slower, since it needs to download gradle and build the build scripts before getting to the actual code. Subsequent builds with changes to the code are comparable to the old builds. Null builds are faster. Enabling the gradle daemon speeds up subsequent builds by around 5s.

* Move Flutter Gradle plugin to Flutter root.
2017-02-10 09:37:38 +01:00
Alexandre Ardhuin e151a1a438 prefer_contains (#8040) 2017-02-09 15:17:55 -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
Devon Carew b180caae4a change a few more places to use the seconds display for log output (#7995) 2017-02-08 19:47:12 -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
xster 1cc78145fe Add logger indent option and indent nested xcode command outputs (#7867)
* Add indent option to logger and indent non-flutter nested output

* Add a missed override

* Formatting
2017-02-08 18:27:47 -08:00
Ian Hickson f17e3f45a5 Fix the 'p' command in hot reload. (#7969)
Turns out when I added tests, I broke the actual underlying functionality.
2017-02-08 14:24:25 -08:00
Devon Carew d89f438699 improve the logger ui a bit for elapsed times (#7960)
* improve the logger ui a bit for elapsed times

* invert param

* update daemon.dart
2017-02-08 08:25:36 -08:00
Chris Bracken 2432b5205b Improve flutter doctor messages for ios-deploy (#7962)
Differentiate between the not-installed and the out-of-date scenario.
2017-02-07 18:52:50 -08:00
Devon Carew f1f53460a4 remove sdk summaries (#7957) 2017-02-07 17:59:10 -08:00
xster 0c8e1813b3 Add a user friendly error message when no development team is selected for physical deployment (#7879) 2017-02-07 16:59:58 -08:00
Devon Carew 27dc043a39 upgrade to the latest usage package (#7917) 2017-02-07 10:01:44 -08:00
Jacob Richman 53fc96da9e Small Flutter strong mode cleanup fixes. (#7825)
* Small Flutter strong mode cleanup fixes.

These are cases where strong mode down cast composite errors
generally indicated cases that would performance or correctness
issues if Flutter code was run in a strong mode VM.

* Fix Command API so that it is always in terms of Map<String,String>.

* Fix typedef
2017-02-06 08:55:09 -08:00
Michael Goderbauer 82f887de07 Fix Flutter Tools Tests to run on Windows (#7878) 2017-02-05 22:58:49 -08:00