Commit Graph

407 Commits

Author SHA1 Message Date
Todd Volkert
9c1aba2abe Skip adb server restarts during device discovery (#9693) 2017-05-01 10:10:16 -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
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
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
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
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
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
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
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
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
Alexandre Ardhuin
189028a958 Separate the 'if' expression from its statement (#9177) 2017-04-04 21:45:50 +02: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
Alexandre Ardhuin
4c530d5e8c prefer_final_fields (#8967) 2017-03-29 21:21:46 +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
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
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
Michael Goderbauer
e01e4c18e1 Fix various gradle paths for Windows (#8935) 2017-03-22 12:31:53 -07:00
Jakob Andersen
f79b333882 Remove unnecessary Android SDK checks. (#8926)
* Remove unnecessary Android SDK checks.

* Remove unused accessors, skip replay test.
2017-03-22 13:51:28 +01:00
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
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
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
Todd Volkert
1b4f817b0c Make tests more hermetic. (#8765)
1. Add `PortScanner` abstraction so that we don't do actual port scanning
   in tests.
2. Don't change the real `cwd` of the isolate during tests, as it affects
   all tests, not just the current running test.

Fixes #8761
2017-03-14 10:28:56 -07:00
John McCutchan
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
John McCutchan
31dc3c4722 Try all possible Android SDK locations before giving up (#8730)
Fixes #8618
2017-03-13 11:21:34 -07:00
Todd Volkert
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
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
Chris Bracken
7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -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
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
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
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
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
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
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
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
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
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
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
Michael Goderbauer
cff7dc5444 Bump package:process version (#8073) 2017-02-10 16:54:51 -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
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
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
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
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
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
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
Todd Volkert
417c2f25fc Migrate flutter_tools to use package:platform (#7642) 2017-01-25 16:06:41 -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
Todd Volkert
9ba607862e Update to package:process v1.0.1 (#7607) 2017-01-24 10:09:29 -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
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
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
Dan Rubel
93e662abaa Cleanup common port forwarding code (#7142)
This moves the various copies of port forwarding code in the Device subclasses into the ProtocolDiscovery class.

* move port forwarding to a common location
* throw exception if protocol Uri is not discovered or port forwarding fails
* cancel discovery protocol subscriptions on iOS launches (wasn't happening before)
* fix iOS port forwarding to match other implementations
* add tests
2016-12-06 09:19:12 -08:00
Chinmay Garde
4efb428254 Unconditionally enable Dart profiling on for all devices and platforms. (#7159)
It is not enabled by default in the VM because applications not launched via the tools may try to connect with the debugger. This causes the debugger and the IDE to hang on Mac.
2016-12-05 13:48:41 -08:00
Dan Rubel
a9584e1214 Handle new observatory url (#7061)
* reapply handle new Observatory URL changes
Fixes https://github.com/flutter/flutter/issues/6843

* allow non numeric IPv4 addresses
Fixes https://github.com/flutter/flutter/issues/7051
2016-11-30 20:29:04 -05:00
Todd Volkert
60b19b2035 Create abstraction layer for dart:io's Process commands (#7100)
With this change, they're run via instance methods on an object
obtained through the context. This will allow us to substitute
that object in tests with replay/record versions to allow us to
mock out the os-layer in tests.
2016-11-30 08:42:42 -08:00
John McCutchan
0b737ac57b Remove default AppContext and cleanup globals (#6999) 2016-11-29 07:54:20 -08:00
Dan Rubel
fcf41fc737 revert handle new Observatory URL (#7056)
737a55ef3e
2016-11-28 16:15:19 -05:00
Dan Rubel
737a55ef3e handle new Observatory URL (#6992) 2016-11-28 11:36:20 -05:00
John McCutchan
c1a3100e4c Remove all the Android specific special cases from the runners (#6957)
- [x] Make iOS and Android application startup paths consisitent.
- [x] Remove the now unncessary Android specific special cases from the runners.
2016-11-21 14:01:35 -08:00
John McCutchan
98016b1c4a Cleanup application startup on Android devices (#6949)
- [x] Stop unnecessarily building the flx a second time on startup.
- [x] Stop unncessarily copying the flx to the device a second time on startup.
- [x] Remove `startBundle` and move logic into `startApp`.
2016-11-21 09:21:49 -08:00
Todd Volkert
9cb914df17 Allow for application-specific log readers. (#6898)
* Allow for application-specific log readers.

When running with prebuilt application binaries, those applications
aren't guaranteed to be named "Runner" (as it is when we build
the app locally in Flutter tools)
2016-11-16 17:19:00 -08:00
Dan Rubel
e384c0d982 Refactor flutter command exit code - part 2 (#6817)
* convert pubGet to throw ToolExit on non-zero exit code
* convert commandValidator to throw ToolExit for non-zero exit code
* convert flutter commands to throw ToolExit for non-zero exit code
* use convenience method throwToolExit
* only show "if this problem persists" for unusual exceptions
2016-11-13 22:09:03 -05:00
John McCutchan
e908655207 Remove legacy restart support (#6801) 2016-11-10 11:12:59 -08:00
John McCutchan
fb3bf7a9d7 Support hot reload with a prebuilt loader (#6743) 2016-11-07 14:25:07 -08:00
Devon Carew
fcfb2a5c55 Better progress (#6677)
* make showElapsedTime default to true

* support nested progresses

* improve hot reload message

* rethrow
2016-11-03 13:28:17 -07:00
Dan Rubel
d86900d22f Update flutter doctor text (#6682) 2016-11-03 13:17:35 -04:00
John McCutchan
751539c86a Manually filter old android device log messages instead of relying on -T. (#6630)
Fixes https://github.com/flutter/flutter/issues/6280
2016-11-01 23:47:47 +01:00
Todd Volkert
0206a9150f Add "android-stable" as a named version (#6620) 2016-11-01 12:28:47 -07:00
Ian Hickson
a33b70ed33 Clean up 'flutter run' output. (#6610)
Fixes #4166.
Fixes #5120.
Fixes #5399.
Fixes #6507.
2016-10-31 21:57:59 -07:00
Dan Rubel
b60d096bbb show install progress during flutter run (#6594) 2016-10-31 13:56:00 -04:00
Dan Rubel
311d371a97 display ANDROID_HOME env var in flutter doctor (#6558) 2016-10-27 22:24:50 +01:00
Dan Rubel
7acc996547 update Android device detection to handle adb error messages (#6521) 2016-10-27 12:06:47 +01:00
Dan Rubel
0b49d81cb2 flutter devices/doctor report Android (and iOS) version (#6545)
* refactor device descriptions method - easier to add columns
* show device SDK version
2016-10-27 09:07:21 +01:00
Chris Bracken
d4c2481e37 Fix doc comments typos (#6499) 2016-10-24 13:03:15 -07:00
Jason Simmons
1b2049eff4 Fix app refresh on Android in no-hot-reload mode (#6435)
Also remove the obsolete "flutter refresh" command
2016-10-20 12:37:04 -07:00
Dan Rubel
e20ee045ba Flutter doctor detect IntelliJ on Mac (#6262)
* cleanup obtaining user home directory path
* refactor doctor and detect IntelliJ on Mac
* fix detect Flutter plugin for IntelliJ
2016-10-13 10:44:20 -04:00
John McCutchan
ca8070f904 Fix flutter run --use-application-binary (#6106)
When using --use-application-binary:

- [x] Stop flutter run from checking for a pubspec.yaml in current directory
- [x] Stop flutter run from invoking pub get
- [x] Set 'shouldBuild' based on --use-application-binary
- [x] Stop requiring 'lib/main.dart' to be present before running.
- [x] Stop building an FLX when launching on Android
2016-09-28 08:46:16 -07:00
Devon Carew
20e9fbfe6d fix an encoding issue with calling adb shell getprop (#5740)
* fix an encoding issue with calling adb shell getprop

* move code in catch block

* add a test

* switch to LATIN1 encoding
2016-09-26 12:47:34 -07:00
Dan Rubel
bad957d457 remove unused methods (#5837)
cleanup https://github.com/flutter/flutter/issues/5789
2016-09-13 12:01:04 -04:00
Dan Rubel
023b7de11f show device list in flutter doctor output (#5697)
* show device list in flutter doctor output
fixes https://github.com/flutter/flutter/issues/5625
2016-09-01 17:55:16 -04:00
Alexandre Ardhuin
886f588df6 Update gradle.dart (#5610) 2016-08-26 07:51:37 -07:00
Devon Carew
74446d78fc don't resolve symlinks as part of which (#5531)
* don't resolve symlinks as part of which

* update method dartdoc
2016-08-22 14:35:19 -07:00
Devon Carew
24f63e2b44 show better errors for gradle build failures (#5374) 2016-08-13 12:30:14 -07:00
John McCutchan
cab7c8d7b3 Rename Observatory to VMService (#5349) 2016-08-11 13:14:13 -07:00
John McCutchan
0de691621b Add --hot mode for flutter run 2016-07-20 14:38:25 -07:00
Devon Carew
57b76a050f Hello services run (#4969)
* making flutter run work with gradle

* locate android studio

* add test for settings

* review comments
2016-07-19 20:00:02 -07:00
Ryan Macnak
d33da2fadd Also forward VM prints. (#4909) 2016-07-13 09:17:24 -07:00
Devon Carew
f0671edfdb workaround adb logcat -T (#4798) 2016-07-01 10:19:28 -07:00
Devon Carew
b6c3ae37f6 send supportsRestart flag when starting an app (#4513)
* send supportsRestart flag when starting an app

* remove unused imports

* review comments
2016-06-13 13:16:20 -07:00
Kaiyuan Wang
8446ae3c87 Fix flutter drive crash issue when run in develop mode (#4492) 2016-06-09 12:39:14 -07:00
Jason Simmons
00c7734c8b Tools daemon handlers for discovering apps and forwarding device ports (#4324) 2016-06-02 14:00:27 -07:00
Todd Volkert
51d4ab3324 Fix install for iOS simulator, and add ability to uninstall (#4223) 2016-05-27 11:05:10 -07:00
Devon Carew
ec7517766c Flutter run restart (#4105)
* working on making a faster flutter run restart

* clean up todos; fire events on isolate changes

* use the Flutter.FrameworkInitialization event

* review comments
2016-05-26 15:26:14 -07:00
Jason Simmons
5aa9a7fc53 Forward the observatory (but not the diagnostic server) when in profile mode (#4183) 2016-05-25 15:21:11 -07:00
Todd Volkert
cc8c78adf4 iOS tools cleanup (#4161)
* iOS tools cleanup

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

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

Fixes #3947
Fixes #1823
2016-05-24 16:25:40 -07:00
Chinmay Garde
66fee3a622 Wire up ios-profile and ios-release. Switching between debug, profile and release starts the build process from scratch. (#4063) 2016-05-23 12:58:42 -07:00
Devon Carew
17b9c12b80 adjust adb logcat filter (#4104) 2016-05-23 12:04:07 -07:00
Todd Volkert
3042da9f6d Prefer getAdbPath(androidSdk) over androidSdk.adbPath (#4076)
For developers with the platform tools installed but no SDK, it prevents
crashing in the flutter tool in favor of more user-friendly error messages
downstream.
2016-05-20 10:45:35 -07:00
Devon Carew
3b3b0ff1bb make sdb getprop less verbose (#4053) 2016-05-19 14:10:09 -07:00
Jason Simmons
fc61060421 Log an error if the Android intent fails during flutter refresh (#3988) 2016-05-17 14:35:11 -07:00
Jason Simmons
c192a7e4ca Replace the checked flag in DebuggingOptions with the build mode (#3901)
This also fixes some related problems affecting "flutter run":
  * FLXes built during AndroidDevice.startApp need to match the build mode
  * APKs should always be rebuilt if the build mode uses AOT compilation
2016-05-17 12:38:25 -07:00
Devon Carew
cc5d1adcfc handle an exit code from android n (#3914)
* handle an exit code from android n

* review comments
2016-05-13 16:47:30 -07:00
Devon Carew
40c0d6ea12 Consolidate observatory code (#3892)
* rename service_protocol.dart to protocol_discovery.dart

* add a wrapper around the obs. protocol

* use json-rpc in run

* consolidate obs. code; implement flutter run --benchmark

* review comments
2016-05-12 18:15:23 -07:00
Phil Quitslund
616d9e2ea8 Merge pull request #3880 from pq/void_setters
Turn on `avoid_return_types_on_setters` and cleanup annotated setters.
2016-05-12 12:28:15 -07:00
Jason Simmons
a590ee2671 Remove BuildConfigurations (#3879)
Artifacts from local engine builds will be found based on the --local-engine flag
2016-05-12 12:22:15 -07:00
pq
e54196d7fc Turn on avoid_return_types_on_setters and cleanup annotated setters.
It's safe to remove the unneeded `void`s from setters since the blocking issues in the
`always_declare_return_types` lint have been fixed (https://github.com/dart-lang/linter/).  We can also safely flip the bit on  `avoid_return_types_on_setters`.
2016-05-12 11:45:30 -07:00
Jason Simmons
0f53f7966b Remove Toolchain and extend ToolConfiguration to locate host tools such as sky_snapshot (#3870)
Host tools can be found in the artifact cache directory for the host platform.
If a developer wants to use a local engine build instead, then provide an
--engine-build flag that selects the specific engine build variant.
2016-05-11 15:47:26 -07:00
Devon Carew
45db865079 be more lenient when looking for matching android sdk components (#3830)
* be more lenient when looking for matching android sdk components

* use a null aware operator
2016-05-11 15:34:24 -07:00
Collin Jackson
e2ab858202 Fix #3825 crash installing onto certain Android devices 2016-05-11 09:32:35 -07:00
Jason Simmons
4d0e6984c2 Build tool support for Android x86 targets in 32- or 64-bit modes (#3761) 2016-05-05 16:04:22 -07:00
Devon Carew
f34d31717c complain on missing entries in flutter.yaml (#3731)
* complain on missing entries in flutter.yaml

* change to a hard failure
2016-05-04 12:33:34 -07:00
Devon Carew
e365453eac better parsing of adb devices output (#3726)
* better parsing of adb devices output

* re-order lines
2016-05-04 12:32:46 -07:00
Devon Carew
c9010c91f6 fix analysis errors (#3677)
* fix analysis errors

* review comments; fix test

* re-add an export for debugPrint
2016-05-03 09:09:00 -07:00
Jason Simmons
30d8dc1399 Check the adb install output for errors and stop "flutter run" if package installation fails (#3672) 2016-05-02 14:11:40 -07:00
Devon Carew
60755f6d9c fix an issue parsing adb output (#3629) 2016-04-29 09:52:44 -07:00
Devon Carew
99114cd414 show more errors on missing jarsigner (#3626) 2016-04-28 22:48:01 -07:00
Yegor
c2cccc7b3b [tools] teach flutter run to get startup trace info (#3589) 2016-04-27 17:58:20 -07:00
Devon Carew
b0dca79671 Flutter run (#3553)
* rework flutter run

* fix npe with --debug-port

* connect to obs and exit when that conneciton closes

* update todos
2016-04-27 14:43:42 -07:00
Devon Carew
ace1a64bfd don't print installing device twice (#3520) 2016-04-25 09:25:47 -07:00
Jason Simmons
8451b669c8 Collect trace data through the observatory HTTP interface (#3393) 2016-04-19 10:38:49 -07:00
Devon Carew
26906240e5 fix an issue parsing adb devices (#3235) 2016-04-11 07:50:03 -07:00
Devon Carew
1311ae6ffe add a target for android-x64 (#3224)
* add a target for android-x64

* update armeabi-v7a to x86_64
2016-04-08 14:04:46 -07:00
Adam Barth
e456d86327 Update engine (#3214)
Also, update hello_android to use the new Java class names.
2016-04-08 10:25:41 -07:00
Jason Simmons
9d022ed26d Add a command that can capture a Skia picture of a Flutter frame and send it to a file or skiaserve debugger (#3165) 2016-04-07 12:33:11 -07:00
Jason Simmons
379c563b62 Merge pull request #3034 from jason-simmons/gradle_flx_refresh
Support "flutter refresh" in the Gradle-based sample project
2016-04-01 12:39:04 -07:00
Jason Simmons
d4bc6d5e0c Add all variants of the Roboto font as assets to Material Design apps 2016-03-28 09:53:16 -07:00
Devon Carew
15b9e1ddb0 add a screenshot command 2016-03-25 22:01:32 -07:00
Devon Carew
2fc8e9a110 create a crash report 2016-03-25 13:29:15 -07:00
Devon Carew
c3eec6ec4f several fixes to the doctor command 2016-03-24 14:17:49 -07:00
Devon Carew
7940e26b04 Merge pull request #2862 from devoncarew/less_noisy_android
filter some noisy messages from adb logcat
2016-03-24 09:20:20 -07:00
Devon Carew
25f332d8d7 re-work the doctor command 2016-03-23 21:12:29 -07:00
Devon Carew
017f0271b7 filter some noisy messages from adb logcat 2016-03-23 21:12:04 -07:00
Devon Carew
99b70dab62 handle android n in the android sdk 2016-03-17 15:30:47 -07:00
John McCutchan
83e6ee36a0 Sniff service protocol port from device 2016-03-17 11:44:16 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Ian Hickson
d745e20853 Even more types 2016-03-14 09:41:54 -07:00
Devon Carew
f13314867c Merge pull request #2645 from devoncarew/platform_constants
rename the platform constants
2016-03-12 12:46:55 -08:00
Devon Carew
3ce1685d6d update comments for android abi 2016-03-12 11:47:50 -08:00
Devon Carew
e939b152af rename the platform constants 2016-03-12 11:08:21 -08:00
Devon Carew
5b383a0353 Merge pull request #2643 from devoncarew/fix_adb_forward
fix a regression in adb forward
2016-03-12 11:00:08 -08:00
Devon Carew
ce9111b591 fix a regression in adb forward 2016-03-12 10:41:34 -08:00
Devon Carew
ad7a666a3e fix a launch issue when the user has deleted the app 2016-03-11 15:44:24 -08:00
John McCutchan
5e140b7533 Add DevicePortForwarder with adb fix 2016-03-11 09:26:17 -08:00
Ian Hickson
1b9cd52081 Enable ALL THE LINTS
Well, all the easy ones, anyway.

For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).

This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
2016-03-10 23:15:31 -08:00
Eric Seidel
37f0b5dd98 Revert "Add DevicePortForwarder" 2016-03-10 14:23:39 -08:00
John McCutchan
131359f4bc Add DevicePortForwarder 2016-03-10 12:49:07 -08:00
Hixie
c7339de6bc Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
2016-03-09 17:57:39 -08:00
Devon Carew
2e9fef8c46 fix a regression in flutter logs 2016-03-09 10:48:34 -08:00
Devon Carew
ee5c5970dc fix npe in lastLogcatTimestamp 2016-03-08 19:04:49 -08:00
John McCutchan
8803cecea1 Refactor DeviceLogReader 2016-03-08 10:38:22 -08:00
Adam Barth
ad718a8d1e Teach flutter logs to show only new logs
After this patch, the flutter logs command on Android shows only log messages
since the command was run. Previously, it showed historical logs, which was
confusing.

Fixes #2013
2016-02-29 12:05:07 -08:00
Devon Carew
d326991b97 add back a call to device.stop() from the run command 2016-02-27 19:32:02 -08:00
Devon Carew
4e10bf596c improve startup time 2016-02-27 08:19:19 -08:00
Devon Carew
022047f5eb remove the isConnected() method from device 2016-02-26 13:23:48 -08:00
Yegor Jbanov
677e63b79d decouple flutter drive from flutter start
flutter start's method of finding devices to run the app on is not suitable for flutter drive.

This commit also refactors several tool services to allow mocking in unit tests.
2016-02-26 10:18:24 -08:00
Devon Carew
80d6130463 Update android_workflow.dart 2016-02-25 11:36:17 -08:00
Devon Carew
6e0c4f0fcf Update android_workflow.dart
fix https://github.com/flutter/flutter/issues/2157
2016-02-25 09:25:06 -08:00
Devon Carew
9367b86abe add a validator for Atom 2016-02-23 10:25:14 -08:00
Devon Carew
488e5dcd6c log for specific adb devices 2016-02-21 00:23:13 -08:00
Devon Carew
67046f933d add the ability to start and stop device polling 2016-02-20 22:00:11 -08:00
Chinmay Garde
d797995632 tvOS, watchOS and old simulators are blacklisted in the tools 2016-02-19 16:29:41 -08:00
Adam Barth
b7ee5980ea Enable background compilation 2016-02-19 13:06:55 -08:00
Devon Carew
d5a6fceee5 add a summary option to the doctor class 2016-02-17 09:33:45 -08:00
Devon Carew
6a6b6539c8 Merge pull request #1947 from devoncarew/less_ios
make the ios development path less mandatory
2016-02-17 00:48:00 -08:00
Devon Carew
7ae6f7f391 make the ios development path less mandatory 2016-02-17 00:38:47 -08:00
Adam Barth
bef8d081ed Improve error message when Android SDK not found
Also, look for the Android SDK in the default locations.
2016-02-16 17:02:52 -08:00
Devon Carew
b7b06c2a27 fixes found when running through the getting started process 2016-02-15 14:06:23 -08:00
Devon Carew
dcf0b7bae6 allow any android sdk version 2016-02-13 14:37:41 -08:00
Devon Carew
2dbceafbc6 introduce globals scoped to the app's context 2016-02-09 22:03:13 -08:00
Jason Simmons
8baffeb9a6 Merge pull request #1724 from jason-simmons/refresh_update_snapshot
Add a refresh command that rebuilds the snapshot and reloads it on th…
2016-02-09 16:22:51 -08:00
Devon Carew
36b6210c93 filter offline devices from notifications 2016-02-09 13:30:21 -08:00
Jason Simmons
bf1246d881 Add a refresh command that rebuilds the snapshot and reloads it on the device
This provides a fast way to iterate on changes to a Flutter app that only
involve updates to Dart code and do not require a full build and install
of the FLX and APK
2016-02-09 13:08:19 -08:00
Devon Carew
9e6d45cb03 general refactoring around device management
remove the device factory methods as well as the device cache
2016-02-06 11:49:48 -08:00
Devon Carew
4ff43bf418 get the adb device name when using the adb server 2016-02-04 14:03:16 -08:00
Devon Carew
b780c07622 add --start-paused,--debug-port flags 2016-02-02 11:38:56 -08:00
Devon Carew
78e05884ed refactor flutter logs 2016-02-01 12:56:46 -08:00
Jason Simmons
12419d6bcf Merge pull request #1446 from jason-simmons/app_process_restart
Add a --full-restart flag to the start command that controls whether …
2016-01-28 14:23:01 -08:00
Jason Simmons
0eb970f7f0 Add a --full-restart flag to the start command that controls whether we stop the application process
SkyActivity now allows reloading application Dart code within an existing
activity.  If a SkyActivity instance is already running, then passing
--no-full-restart will restart the Dart code without killing and restarting
the SkyShell application.
(full-restart will remain the default until the engine
that supports this is rolled out)

Also remove the obsolete --poke flag
2016-01-28 14:13:42 -08:00
Devon Carew
d7fbf5302d use status(), error(), and trace() for logging
rename to printTrace(), printStatus(), and printError()
2016-01-28 12:44:17 -08:00
Devon Carew
7ac4e6248f refactor the list command 2016-01-27 14:03:41 -08:00
Jason Simmons
58ba5129e3 Allow collection of trace files when adbd is not running as root
Also fix a bug where the trace command may capture the wrong file
if multiple trace file paths are in the Android log buffer.

Previously we found a lower bound timestamp for the trace path log
by running the date command on the device and parsing the result on
the host.  This could yield an inaccurate result if the device and
host are using different time zones.

The command will now obtain the most recent timestamp in the device's
time format by running logcat.
2016-01-27 10:57:13 -08:00
Devon Carew
5bce2fbdec refactor platform specific code out of device.dart
remove device type specific checks
2016-01-22 10:51:49 -08:00
Devon Carew
2727954d0e review comments 2016-01-19 13:15:58 -08:00
Devon Carew
077ee32ea5 guard against npe 2016-01-19 12:15:11 -08:00
Devon Carew
677a80c16b add a wrapper around the adb command 2016-01-19 11:31:20 -08:00