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

Release 2.0.1 #141

Merged
merged 6 commits into from
Mar 21, 2018
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.0.1

_2018-03-21_

Fixes a bug that lead to a NullPointerException when executing `install` and `run` tasks, see this [issue](https://github.com/novoda/gradle-android-command-plugin/issues/138).
As a side-effect, `deviceId` can not be set via the new DSL. Set it within the `command` extension for now.

# 2.0

_2018-01-30_
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.novoda:gradle-android-command-plugin:2.0'
classpath 'com.novoda:gradle-android-command-plugin:2.0.1'
}
}
```
Expand Down Expand Up @@ -219,6 +219,8 @@ More flags can be found in the `install` section of [the official adb document](

**deviceId**

*Note:* Due to a [bug](https://github.com/novoda/gradle-android-command-plugin/issues/138), setting `deviceId` has been disabled for version `2.0.1`.

Here is how you can install on a specific device using `deviceId`

```groovy
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
}

group = 'com.novoda'
version = '2.0'
version = '2.0.1'

publish {
userOrg = 'novoda'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class InstallTaskFactory {
description = VariantAwareDescription.descriptionFor(variant, extension, DEFAULT_DESCRIPTION)
group = 'install'
installExtension = extension
conventionMapping.deviceId = { extension.deviceId }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class RunTaskFactory {
variantAwareTaskFactory.create(variant, "run${extensionSuffix}", Run, 'installDevice').configure {
description = VariantAwareDescription.descriptionFor(variant, extension, RUN_DEFAULT_DESCRIPTION)
group = 'adb start'
conventionMapping.deviceId = { extension.deviceId }
}

variantAwareTaskFactory.create(variant, "start${extensionSuffix}", Run).configure {
description = VariantAwareDescription.descriptionFor(variant, extension, START_DEFAULT_DESCRIPTION)
group = 'adb start'
conventionMapping.deviceId = { extension.deviceId }
}
}

Expand Down
29 changes: 1 addition & 28 deletions sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,36 +92,9 @@ android {
customFlags = ['-d']
}

onNewestDevice {
deviceId {
def device = devices().max { it.sdkVersion() }
device.id
}
}

currentUser.customFlags = ['--user', 'current']
}

// More info: https://github.com/novoda/gradle-android-command-plugin#start
start {
amazon {
deviceId {
def kindle = devices().find { it.brand() == 'Amazon' }
if (!kindle) {
throw new GroovyRuntimeException('No Amazon device found')
}
kindle.id
}
}

onNewestDevice {
deviceId {
def device = devices().max { it.sdkVersion() }
device.id
}
}
}
}
}
}

task listDevices doLast {
Expand Down