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

Commit

Permalink
Merge pull request #141 from novoda/develop
Browse files Browse the repository at this point in the history
Release 2.0.1
  • Loading branch information
ouchadam authored Mar 21, 2018
2 parents 87cbae8 + 2c2d885 commit 7bdfb8b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
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

0 comments on commit 7bdfb8b

Please sign in to comment.