diff --git a/CHANGELOG.md b/CHANGELOG.md index 65cd1ac..0008085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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_ diff --git a/README.md b/README.md index 41e9df3..f6565de 100644 --- a/README.md +++ b/README.md @@ -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' } } ``` @@ -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 diff --git a/plugin/build.gradle b/plugin/build.gradle index bc0dbf1..a900316 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -23,7 +23,7 @@ dependencies { } group = 'com.novoda' -version = '2.0' +version = '2.0.1' publish { userOrg = 'novoda' diff --git a/plugin/src/main/groovy/com/novoda/gradle/command/InstallTaskFactory.groovy b/plugin/src/main/groovy/com/novoda/gradle/command/InstallTaskFactory.groovy index feecc1e..de0bb7d 100644 --- a/plugin/src/main/groovy/com/novoda/gradle/command/InstallTaskFactory.groovy +++ b/plugin/src/main/groovy/com/novoda/gradle/command/InstallTaskFactory.groovy @@ -19,7 +19,6 @@ class InstallTaskFactory { description = VariantAwareDescription.descriptionFor(variant, extension, DEFAULT_DESCRIPTION) group = 'install' installExtension = extension - conventionMapping.deviceId = { extension.deviceId } } } diff --git a/plugin/src/main/groovy/com/novoda/gradle/command/RunTaskFactory.groovy b/plugin/src/main/groovy/com/novoda/gradle/command/RunTaskFactory.groovy index b522efe..6018dcb 100644 --- a/plugin/src/main/groovy/com/novoda/gradle/command/RunTaskFactory.groovy +++ b/plugin/src/main/groovy/com/novoda/gradle/command/RunTaskFactory.groovy @@ -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 } } } diff --git a/sample/app/build.gradle b/sample/app/build.gradle index 11e0712..5bae2c9 100644 --- a/sample/app/build.gradle +++ b/sample/app/build.gradle @@ -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 {