diff --git a/README.md b/README.md
index 44e59ff0..6c1d8c86 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ dg deploy
1) Open your build.gradle
on your project root and add a dependency.
```groovy
dependency {
- classpath 'com.deploygate:gradle:1.1.2'
+ classpath 'com.deploygate:gradle:1.1.3'
}
```
@@ -140,6 +140,10 @@ Note that these values are used as default values so `build.gradle` may override
# Changes
+## ver 1.1.3
+
+ * Restore auto configuring APK file path functionality (supports Android Gradle Plugin 3.0.0-alpha4)
+
## ver 1.1.2
* Fix failing first time upload with Free plans
diff --git a/build.gradle b/build.gradle
index 2bd7ae0a..64e1af21 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ apply plugin: 'com.jfrog.bintray'
group = 'com.deploygate'
archivesBaseName = 'gradle'
-version = '1.1.2'
+version = '1.1.3'
repositories {
mavenCentral()
@@ -13,6 +13,7 @@ repositories {
dependencies {
compile gradleApi()
compile localGroovy()
+
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
compile 'org.apache.httpcomponents:httpmime:4.2.5'
runtime 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
@@ -51,7 +52,7 @@ bintray {
vcsUrl = 'https://github.com/DeployGate/gradle-deploygate-plugin.git'
githubRepo = 'DeployGate/gradle-deploygate-plugin'
version {
- name = '1.1.2'
+ name = '1.1.3'
released = new Date()
}
}
diff --git a/src/main/groovy/com/deploygate/gradle/plugins/Config.groovy b/src/main/groovy/com/deploygate/gradle/plugins/Config.groovy
index 14125e8c..1e2f418a 100644
--- a/src/main/groovy/com/deploygate/gradle/plugins/Config.groovy
+++ b/src/main/groovy/com/deploygate/gradle/plugins/Config.groovy
@@ -1,7 +1,7 @@
package com.deploygate.gradle.plugins
class Config {
- static final def VERSION = '1.0.4'
+ static final def VERSION = '1.1.3'
static final def USER_AGENT = "gradle-deploygate-plugin/${VERSION}"
static final def DEPLOYGATE_ROOT = 'https://deploygate.com'
}
diff --git a/src/main/groovy/com/deploygate/gradle/plugins/DeployGate.groovy b/src/main/groovy/com/deploygate/gradle/plugins/DeployGate.groovy
index de6e90ce..d48294b8 100644
--- a/src/main/groovy/com/deploygate/gradle/plugins/DeployGate.groovy
+++ b/src/main/groovy/com/deploygate/gradle/plugins/DeployGate.groovy
@@ -43,7 +43,7 @@ class DeployGate implements Plugin {
project.android.applicationVariants.all { variant ->
// variant is for splits
variant.outputs.each { output ->
- createTask(project, output, loginTask)
+ createTask(project, output, loginTask, variant)
tasksToCreate.remove output.name
}
}
@@ -53,7 +53,7 @@ class DeployGate implements Plugin {
}
}
- private void createTask(project, output, loginTask) {
+ private void createTask(project, output, loginTask, variant = null) {
def name
def signingReady = true
def isUniversal = true
@@ -69,9 +69,7 @@ class DeployGate implements Plugin {
// TODO Workaround for 3.0.0 Preview, until the new API released
signingReady = output.hasProperty('variantOutputData') ? output.variantOutputData.variantData.signed : true
- try {
- outputFile = output.outputFile
- } catch (Exception ignored) {}
+ outputFile = findOutputFile(output, variant)
}
def capitalized = name.capitalize()
@@ -108,6 +106,18 @@ class DeployGate implements Plugin {
}
}
+ def findOutputFile(output, variant) {
+ try {
+ // Android plugin < 3.0.0 way
+ return output.outputFile
+ } catch (Exception ignored) {}
+
+ if (variant) try {
+ // Android plugin 3.0.0-alpha way
+ return variant.variantData.scope.apkLocation
+ } catch (Exception ignored) {}
+ }
+
def createMultipleUploadTask(Project project, HashSet dependsOn) {
if (dependsOn.empty) return
project.task 'uploadDeployGate',
diff --git a/src/main/groovy/com/deploygate/gradle/plugins/tasks/UploadTask.groovy b/src/main/groovy/com/deploygate/gradle/plugins/tasks/UploadTask.groovy
index 8c460b8d..1a7b3259 100644
--- a/src/main/groovy/com/deploygate/gradle/plugins/tasks/UploadTask.groovy
+++ b/src/main/groovy/com/deploygate/gradle/plugins/tasks/UploadTask.groovy
@@ -29,7 +29,7 @@ class UploadTask extends DefaultTask {
DeployTarget target = findTarget()
if (!target.sourceFile?.exists())
- throw new GradleException("APK file was not found. If you are using Android Build Tools >= 3.0.0, you need to set `sourceFile` in your build.gradle. See https://docs.deploygate.com/docs/gradle-plugin")
+ throw new GradleException("APK file ${target.sourceFile} was not found. If you are using Android Build Tools >= 3.0.0, you need to set `sourceFile` in your build.gradle. See https://docs.deploygate.com/docs/gradle-plugin")
onBeforeUpload(target)
def res = uploadProject(project, target)