Commit Graph

1499 Commits

Author SHA1 Message Date
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
Chris Bracken
c7054b302b Improved ensureDirectoryExists error message (#7880) 2017-02-03 18:09:07 -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
cce70d7069 Improved error message for iOS device on a non-Mac host (#7859)
And fix some un-grammatical language below.
2017-02-03 12:54:07 -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
104fcf8d08 Fix typos, quote consistency (#7856) 2017-02-03 11:50:49 -08:00
Ian Hickson
dc634e195e Introduce the concept of asynchronicity to the service extensions. (#7823)
This allows us, for example, to wait for the slow mode banner to have
been removed from the screen before triggering a screen shot.
2017-02-02 15:48:35 -08:00
Michael Goderbauer
a742a5ddf6 Make flutter analyze run on Windows (#7828) 2017-02-02 15:41:13 -08:00
Jason Simmons
d2a1e125e9 Do not print logs whose timestamp is equal to the last timestamp seen (#7827)
If the tool is started immediately after a previous run of the tool, then
the most recent log timestamp may come from the previous run's logs.
The new instance of the tool should not print those logs.

This was happening during runs of the microbenchmark script.
2017-02-02 12:48:53 -08:00
Luke
646d7404cb Fix issues with flutter doctor (#7808)
* fix issue detecting ios-deploy. fix issue matching IntelliJ Ultimate on Mac

* refactor directory navigation code
2017-02-02 00:19:10 -08:00
Ian Hickson
5f38773ed0 Screenshot improvements (#7800)
Add an "s" command to `flutter run` which takes a screenshot.
Make that comment turn off the slow mode banner.
2017-02-01 22:47:53 -08:00
Michael Goderbauer
829976d35e Work around for dart-lang/sdk#28603 (#7805) 2017-02-01 21:06:19 -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
Michael Goderbauer
40aab7f553 Bump Dart SDK to 1.22.0-dev.10.3 (#7791) 2017-02-01 16:33:27 -08:00
Chris Bracken
50125ab271 Use ios-deploy --version for install check (#7797)
ios-deploy -h/--help returns a non-zero exit code.
2017-02-01 16:30:49 -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
Michael Goderbauer
84de5e815d Work around for dart-lang/sdk#28599 (#7786) 2017-02-01 13:39:19 -08:00
Chris Bracken
236e8137b8 Ensure that ios-deploy meets minimum version constraint (#7784)
Also emits the version information in flutter doctor output.

ios-deploy > 1.9.0 is required to deploy to iOS devices.
2017-02-01 12:55:03 -08:00
Jason Simmons
59cacd7102 Some fixes for the microbenchmarks (#7781)
* Return null from VM.mainView if no view exists
* Retry in connectToServiceProtocol if a view is not yet available
* Do not explicitly call exit from the benchmarks - it will not cleanly shut down the engine
2017-02-01 11:54:27 -08:00
Jakob Andersen
a0f0c42fe3 Update gradle example to support x86 in debug mode. (#7606)
* Update gradle example to support x86 in debug mode.

Changed the Flutter Gradle plugin a bit to better fit in with the
Android build.

Fixes #6136
Fixes #6864
Fixes #7539
2017-01-31 14:48:48 -08:00
Michael Goderbauer
4cace66dbc Download prebuilt binaries on Windows (#7760) 2017-01-31 14:33:08 -08:00
Devon Carew
8e3ea7523e fix app launch in intellij (#7737) 2017-01-30 13:01:41 -08:00
Ian Hickson
65ca387075 Make the Ahem font available to tests. (#7725) 2017-01-28 15:55:47 -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
Michael Goderbauer
c234d405af Replace bin/flutter.ps1 with bin/flutter.bat (#7713)
fixes https://github.com/flutter/flutter/issues/7654
2017-01-27 23:12:33 -08:00
Ian Hickson
21434fcf1a Refactor 'flutter drive' to get the observatory port from the logs (#7695)
This remove a very brittle aspect of flutter drive, whereby it would
assume a known port instead of explicitly finding out what it was.

Fixes #7692 and hopefully fixes the devicelab tests.
2017-01-27 01:37:28 -08:00
Ian Hickson
f888bbed48 Refactor hot/cold/drive runners a little (#7694)
Move the drive/run common stuff to RunCommandBase, rather than the
superclass which applies to everything.

Implement --no-resident (fixes
https://github.com/flutter/flutter/issues/5448). This is particularly
useful when running flutter from scripts.

Rename RunAndStayResident to ColdRunner.
2017-01-27 01:03:04 -08:00
Ian Hickson
a67c79a1c7 converge flutter run and flutter drive onto one behavior (#7688)
...for the port arguments
2017-01-26 21:47:14 -08:00
Ian Hickson
19d22c9726 Make devicelab count as a bot so we can see crash logs (#7687) 2017-01-26 20:17:40 -08:00
Michael Goderbauer
9f28b4ff71 Windows Fixes for Flutter Tools (#7678) 2017-01-26 17:04:53 -08:00
Ian Hickson
576b4e1179 Change --debug-port to --observatory-port (#7675)
...and add --diagnostic-port.

...and document port 0.
2017-01-26 16:42:48 -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
Michael Goderbauer
f3f2747a85 Unify engineDirs and toolsDir in Cache of Flutter Tools. (#7644)
The zip files downloaded from cloud storage are not clearly separated
into engine artifacts and tools anyways.

Also, because of this unclear separation, we were downloading
`linux-x64/artifacts.zip` twice before.
2017-01-26 10:23:52 -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
c47069a6b1 Tiny improvement to flutter doctor output on Windows. (#7629)
Follow-up to #7625
2017-01-24 17:29:06 -08:00
Michael Goderbauer
aaaf0dac19 Teach Flutter Tools about IntelliJ and Android SDK on Windows. (#7622)
Required for https://github.com/flutter/flutter/issues/138
2017-01-24 16:53:20 -08:00
Ian Hickson
1bdf351818 Merge pubspec.yaml and flutter.yaml. (#7605) 2017-01-24 11:19:31 -08:00
Todd Volkert
9ba607862e Update to package:process v1.0.1 (#7607) 2017-01-24 10:09:29 -08:00
Yegor
4bec9cd940 update build benchmark to match #7589 (#7600) 2017-01-23 17:49:01 -08:00
Devon Carew
a6777b2a60 remove flutter setup (#7596) 2017-01-23 15:22:16 -08:00
Ryan Macnak
76460967e6 Adapt to refactoring of snapshot APIs in the Dart VM. (#7589) 2017-01-23 13:28:35 -08:00
Ian Hickson
94cac1a69c flutter test --start-paused (#7584)
Make debugging tests in a debugger easier.

Fixes https://github.com/flutter/flutter/issues/163
2017-01-23 11:31:59 -08:00
Todd Volkert
03d163ce88 Update tools to use package:process (#7590) 2017-01-23 09:46:38 -08:00
Ian Hickson
63aa1397a3 Increase the strictness of our requiring explicit types (#7585)
...now that we have generic methods, their types need to be specified too.
2017-01-23 01:04:31 -08:00
Ian Hickson
cbda208b4b Reduce the amount of spam from analyze watch. (#7582)
See https://github.com/dart-lang/sdk/issues/28463, which I think is a
regression.

This also fixes the regression introduced by
https://codereview.chromium.org/2559773002 whereby we were no longer
checking any of the lints.
2017-01-22 16:43:24 -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
Ian Hickson
15a7eb3b6c Move to real generic method syntax (#7235) 2017-01-21 20:58:44 -08:00
Ian Hickson
2bb800a2e4 Explain the -15 magic number. (#7571) 2017-01-20 16:44:26 -08:00
Todd Volkert
5a3bae9eed Catch another ignorable errno in setting stdin.lineMode (#7563) 2017-01-20 14:00:12 -08:00
Devon Carew
34b9ce859a proxy service extension calls through the daemon protocol (#7554)
* proxy service extension calls through the daemon protocol

* add test for app.callServiceExtension
2017-01-20 08:51:57 -08:00
Ian Hickson
47de51557a Provide a feature to set the ports when running tests. (#7558)
This brings the feature back, since removing it broke one of our more
exotic sets of customers.
2017-01-19 17:57:47 -08:00
Ian Hickson
3f1d6d3bca Remove randomness from port assignment during coverage collection. (#7548)
Also, defer to test package for throttling (this will require a test
package update as well).

Also, add a lot more instrumentation to --verbose mode for tests, and
fix minor trivial things here and there, and add error handling in
more places.

Also, refactor how coverage works to be simpler and not use statics.
2017-01-19 15:31:11 -08:00
Todd Volkert
4e8628c146 Fix sky_shell test flakiness caused by CPU throttling (#7543)
When a machine is heavily loaded, it can severely delay the time it
takes for the OS to start a process once it's asked to do so. Our
5 second timeout that we were giving the test process to connect
to the test harness seemed like plenty of time, were it not for the
fact that the test process itself was not being started in time when
CPU throttling was in effect.

This change updates the test timeout to begin counting only once the
test process has been started. We keep the original timeout in play
in the event that the test process *never* starts up for some reason,
but we up that timeout value to 5 minutes.
2017-01-19 13:03:31 -08:00
Yegor
d18b500840 remove the no longer needed ignore: cancel_subscriptions (#7542)
This has been fixed: https://github.com/dart-lang/linter/issues/317
2017-01-19 10:59:43 -08:00
Phil Quitslund
8dc1634be5 Stop building unlinked summaries for packages. (#7538)
Stop building (unused) unlinked summaries for packages.

Improves update speed considerably (for `n` packages it saves us `n` needless calls to `pub get`).
2017-01-19 09:11:41 -08:00
Phil Quitslund
41251d2450 Update to Dart SDK 1.22.0-dev.8.0. (#7461)
* Update to Dart SDK `1.22.0-dev.6.0`.

* Update SDK summary generation to create spec and strong summaries.

* Updated to dev.8.0.

* Fixed console out.
2017-01-17 09:50:52 -08:00
Todd Volkert
55beaef743 Ignore only ENOTTY when setting stdin.lineMode (#7472) 2017-01-12 16:14:37 -08:00
Devon Carew
6737712067 relax timeouts for some service protocol calls (#7468)
* relax timeouts for some service protocol calls

* remove 'note that' text
2017-01-12 14:03:04 -08:00
Todd Volkert
4f9e5c8dc7 Fix race condition in coverage collection (#7455)
Previously, it was possible for the test harness to bail
and the test runner to complete before the platform plugin
triggered the collection of coverage data. This fixes the
race condition such that the pending coverage collection
task is recorded immediately after starting the process.
2017-01-12 13:58:19 -08:00
Devon Carew
7f2915d331 ignore exceptions from stdin.lineMode (#7439)
* ignore exceptions from stdin.lineMode

* only catch IOException
2017-01-11 10:54:42 -08:00
Todd Volkert
a0666f330e Update Process.exitCode setter to not use @override (#7434)
As of Dart SDK 1.22.0-dev.5.0, `Process.exitCode` is no longer
mutable (that SDK version picks up e5a16b1ca5).
This change allows the tools code to pass analysis in sdk versions both
before and after that change, to allow for analysis against both the host and
target sdks.
2017-01-10 21:33:04 -08:00
Yegor
7a10ed9315 Revert "Bump to Dart SDK 1.22.0-dev.5.0 (#7382)" (#7435)
This reverts commit ef25a20337 to unbreak the build.
2017-01-10 18:14:58 -08:00
Phil Quitslund
ef25a20337 Bump to Dart SDK 1.22.0-dev.5.0 (#7382)
* Bump Dart SDK to 1.22.0-dev.5.0.

* Suppress spurious `FutureOr` type warning.

* Fixed linter dep post merge.

* Formatting tweaks.
2017-01-10 14:55:31 -08:00
Todd Volkert
1ccbf8f00d Use FileSystem.pathSeparator instead of Platform.pathSeparator (#7417) 2017-01-10 13:17:20 -08:00
Jason Simmons
90d18fa808 Fix the type of the default project root path (#7422) 2017-01-10 12:08:33 -08:00
Adam Barth
b9f49a40f7 Handle missing flutter_test dependency cleanly (#7421)
We now produce a more reasonable error message when we're missing the
flutter_test dependency in a test. Also, remove the flutter_tools stack traces
when the engine dies.

Fixes #6187
2017-01-10 11:31:24 -08:00
Todd Volkert
e2847c7221 Fix type passed to printError() (#7416)
Fixes #7413
2017-01-10 10:38:12 -08:00
Jason Simmons
8af5520f56 Do not print stack traces for DevFS write request failures (#7405)
Each stack trace will yield many async task stacks for every write request
that is in flight.  If the device side is unresponsive and all writes are
failing, then this can generate an overwhelming amount of logs.
2017-01-10 10:30:22 -08:00
John McCutchan
6a63af4081 Rebuild Android apk when Dart source is modified (#7345)
- [x] Wire up dependency checker and plumb flags down to the right place

Fixes #7014
2017-01-10 07:59:55 -08:00
Jason Simmons
fb8179bfed Remove a misfiring assert in the test framework plugin (#7397)
Fixes https://github.com/flutter/flutter/issues/7351

When a test runs to completion, the test harness closes the stream side of the
StreamChannel, causing the sink side to be closed as well.  So by the time we
receive a test result of completed/harnessBailed, the controller sink has been
closed.
2017-01-09 16:52:00 -08:00
Devon Carew
258fc011f6 pass additional named params to daemon run (#7392)
* pass additional named params to daemon run

* add a trailing comma
2017-01-09 16:12:41 -08: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