Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Installation errors should break the build #104

Merged
merged 2 commits into from
Jan 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ class Device {
}

String toString() {
getClass().name + [id: id, sdk: sdkVersion(), version: androidVersion(), brand: brand(), manufacturer: manufacturer(), model: model(), country: country(), language: language(), timezone: timezone()]
getClass().simpleName + [id: id, sdk: sdkVersion(), version: androidVersion(), brand: brand(), manufacturer: manufacturer(), model: model(), country: country(), language: language(), timezone: timezone()]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also decided to use simpleName here. The name was too verbose. Now it just says Device which makes sense.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ class Install extends AdbTask {
customFlags ?: ''
}

@Override
protected handleCommandOutput(def text) {
super.handleCommandOutput(text)
def matcher = text =~ /Failure \[(.*?)\]/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat hacky, but fine with me as long at it fixes the behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know with Nougat release, Android team did a lot of refactoring in adb. I remember I listened in this podcast. They know forward exit code and error stream of the command being run on the device when we run adb shell.

Unfortunately adb install always succeeds with this message in it. I think I need to open a bug report about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if (matcher) {
throw new GroovyRuntimeException("Installation failed with error: ${matcher[0][1]}")
}
}
}