Commit Graph

407 Commits

Author SHA1 Message Date
Devon Carew
cbcdd03ef0
some wording tweaks to the doctor text (#13356) 2017-12-06 08:05:51 -08:00
Martin Kustermann
3280f23452
Use only one message for NDK discovery, remove accidental newline (#13348) 2017-12-05 18:17:28 +01:00
Dwayne Slater
c7c3b606fc Show Android tombstone during native crash (#12923)
* Show Android tombstone during native crash

* Fix tombstone lines being missed on newer Android versions
2017-11-22 14:58:59 -08:00
Todd Volkert
e792c6bb5b
Add support for binding to IPv6 localhost in flutter run (#13136)
This allows `flutter run` to work on hosts that are IPv6-only.
2017-11-21 20:12:21 -08:00
Martin Kustermann
545ec9efb7
Add support for NDK discovery and add --prefer-shared-library option (#12788)
* Add support for NDK discovery and add --prefer-shared-library option

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

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

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

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

* Use InMemoryFileSystem for test

* Remove unused import

* Address some analyzer warnings
2017-11-21 15:44:03 +01:00
Todd Volkert
f0e8819886
Extract Android SDK version from named platform dirs. (#13056)
Previously, we were mapping certain named platforms
(e.g. `android-stable`) to their corresponding version.
this had two problems:

1. The version could become out of date. For instance, we had
   mapped `android-stable` to version 24, but the stable version
   is now 27.
2. The list of possible named versions wasn't comprehensive.
   Some Android SDKs just list the platform as `stable`, or
   `experimental`, etc.

This change updates the platform version detection to use
the `build.prop` file that exists in the platform directory
(only for cases where the version number is not encoded into
the directory name).
2017-11-16 17:38:53 -08:00
Todd Volkert
454db9d47c
Re-organize flutter_tools code to better support proper layering. (#12957)
* executable.dart#main() depends on runner.dart#run()
* Refactor code such that non-commands don't depend on commands.

No code was actually changed in this PR - code was merely moved from
point A to point B.
2017-11-09 21:45:31 -08:00
Devon Carew
b6bd628bcd
address unused element issues and new warnings (#12890)
* address unused element issues and new warnings

* add a missing return
2017-11-08 14:06:55 -08:00
Jason Simmons
1affb4237a
Remove the diagnostic server from flutter_tools (#12771) 2017-10-30 15:53:04 -07:00
Alexandre Ardhuin
1fce14a31c enable lint prefer_single_quotes (#12665) 2017-10-22 18:11:36 +02:00
Alexandre Ardhuin
700dc9f752 enable lint avoid_function_literals_in_foreach_calls (#12607) 2017-10-19 08:16:16 +02:00
Alexander Markov
7153dea296 Add hidden options --extra-front-end-options and --extra-gen-snapshot-options to flutter tool (#12219)
This CL introduces 2 hidden options to 'flutter build aot' and 'flutter run' for passing arbitrary arguments to front-end server and to gen_snapshot tool when building and running flutter app in --profile or --release modes.

The ability to pass arbitrary options simplifies various experiments, as it removes the need to change defaults and rebuild flutter engine for every tested configuration.
2017-10-03 12:55:53 -07:00
Michael Thomsen
3f6b28dddb Add a check for gradle failing due to missing licenses (#12318)
* Add a check for gradle failing due to missing licenses

* Review feedback Jakob
2017-09-29 13:49:38 +02:00
xster
987b205665 Delinting future awaits round 2 (#10790)
* round 2

* deal with null futures

* review

* review

* review

* review
2017-09-20 16:25:16 -07:00
Carlo Bernaschina
ba36008af6 Add --trace-skia parameter to flutter run (#12070)
* Add --trace-skia parameter to flutter run

Skia tracing is extremely useful for internal debug, but reduces the
amount of space available in the Dart Timeline buffers.
Disable skia tracing by default and expose them via the --trace-skia
flag.

* Roll Engine to 57a1445a45964d386500c39f5e8d06db060abadb
2017-09-13 12:59:05 -07:00
Alexander Aprelev
c5750cd7ea Introduce --preview-dart-2 option to run new frontend compiler in flutter tools. (#11741)
This adds --preview-dart-2 flag that enables use of Dart 2.0 Frontend in Flutter tools.
2017-08-31 13:35:55 -07:00
Mikkel Nygaard Ravn
79747f4947 Improve Gradle error output in Flutter commands (#11703) 2017-08-24 10:44:32 +02:00
Mikkel Nygaard Ravn
9496e6dfa7 Support for app flavors in flutter tooling, #11676 retake (#11734) 2017-08-23 10:55:35 +02:00
Mikkel Nygaard Ravn
7c3a45dc6e Revert "Support for app flavors in flutter tooling (#11676)" (#11729)
This reverts commit 8d07d3f652.
2017-08-22 12:24:29 +02:00
Mikkel Nygaard Ravn
8d07d3f652 Support for app flavors in flutter tooling (#11676) 2017-08-22 10:38:23 +02:00
Devon Carew
c186d0df1c pass the value of the android sdk (#11268)
* pass the value of the android sdk

* swap flag

* allow the user to set the android-sdk location
2017-07-18 18:47:20 -07:00
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
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
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
Mikkel Nygaard Ravn
030abfd49a Provide user feedback on slow Gradle operations (#11015) 2017-06-29 11:54:03 +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
Todd Volkert
f18083d448 Print ADB output when adb install fails (#10933)
Fixes #10929
2017-06-23 14:08:07 -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
Chris Bracken
1d9f009579 Re-enable use of instruments for iOS device lookup (#10838)
This reverts commit b2909a245a.

This resubmits the following patches:

1. Use Xcode instruments to list devices (#10801)
Eliminates the dependency on idevice_id from libimobiledevice. Instead,
uses Xcode built-in functionality.

2. Make device discovery asynchronous (#10803)
Migrates DeviceDiscovery.devices and all device-specific lookup to be
asynchronous.
2017-06-19 13:14:57 -07:00
Jason Simmons
cfa0a2dbbd Look for APKs at the path used by Android Gradle plugin 3.0 (#10798)
Fixes https://github.com/flutter/flutter/issues/10630
2017-06-19 09:37:39 -07:00
Chris Bracken
b2909a245a Revert use of Xcode instruments for device lookup (#10806)
* Revert "Make device discovery asynchronous (#10803)"
This reverts commit 972be9c8b4.

* Revert "Use Xcode instruments to list devices (#10801)"
This reverts commit 37bb5f1300.

This is to resolve a failure that looks related to a bad install of Xcode 8.0
on our build bots and should be reinstated when the infra issue is diagnosed
and resolved.

Instruments worked well when this was originally landed, and on the
following commit, but started failing two commits after this originally
landed. Manual invocation of instruments on the build host currently
results in:

```
dyld: Library not loaded: @rpath/InstrumentsAnalysisCore.framework/Versions/A/InstrumentsAnalysisCore
  Referenced from: /Applications/Xcode8.0.app/Contents/Developer/usr/bin/instruments
  Reason: image not found
Abort trap: 6
```

It appears the /Applications/Xcode8.0.app/Contents/Applications
directory (which contains Instruments) is missing on the host.
2017-06-16 19:00:31 -07:00
Chris Bracken
972be9c8b4 Make device discovery asynchronous (#10803)
Migrates DeviceDiscovery.devices and all device-specific lookup to be
asynchronous.
2017-06-16 17:47:06 -07:00
Chris Bracken
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
Ian Hickson
0f1a703a6b More documentation (#10589) 2017-06-08 17:13:03 -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
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
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
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
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
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
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
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
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