From 6273dfa848c1ae2ded2e02e2131763c969140b09 Mon Sep 17 00:00:00 2001 From: Volker Leck Date: Tue, 20 Mar 2018 12:47:20 +0100 Subject: [PATCH 1/4] remove custom convention mapping within task factories, as this is breaking default functionality --- .../groovy/com/novoda/gradle/command/InstallTaskFactory.groovy | 1 - .../main/groovy/com/novoda/gradle/command/RunTaskFactory.groovy | 2 -- 2 files changed, 3 deletions(-) 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 } } } From 2b5f0050fc4a42b868c6aefa4d56f9a9be07e9ec Mon Sep 17 00:00:00 2001 From: Volker Leck Date: Wed, 21 Mar 2018 09:05:36 +0100 Subject: [PATCH 2/4] update changelog and docs, bump version to 2.0.1 --- CHANGELOG.md | 7 +++++++ README.md | 2 +- plugin/build.gradle | 2 +- sample/app/build.gradle | 29 +---------------------------- 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65cd1ac..7c01756 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, `device-id` 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..326f72f 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' } } ``` 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/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 { From ca0c197949e2fa92bad2954cb0936eccdb82d978 Mon Sep 17 00:00:00 2001 From: Volker Leck Date: Wed, 21 Mar 2018 09:11:54 +0100 Subject: [PATCH 3/4] add note about device-id limitations in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 326f72f..f6565de 100644 --- a/README.md +++ b/README.md @@ -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 From 5ad1f3dc6f600638127e457750a41b38f4bc0290 Mon Sep 17 00:00:00 2001 From: Antonio Bertucci Date: Wed, 21 Mar 2018 09:43:44 +0100 Subject: [PATCH 4/4] Fix typo in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c01756..0008085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ _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, `device-id` can not be set via the new DSL. Set it within the `command` extension for now. +As a side-effect, `deviceId` can not be set via the new DSL. Set it within the `command` extension for now. # 2.0