From 0e1712f99ec9a16192382665989d4c061f0c2831 Mon Sep 17 00:00:00 2001 From: Piasy Date: Wed, 7 Oct 2015 00:06:35 +0800 Subject: [PATCH] fix #11 --- buildSrc/build.gradle | 2 +- .../com/github/piasy/okbuck/OkBuckGradlePlugin.groovy | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 5f92a9e84..c105a9438 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -76,7 +76,7 @@ dependencies { def siteUrl = 'https://github.com/Piasy/OkBuck' def gitUrl = 'https://github.com/Piasy/OkBuck.git' def publishGroup = 'com.github.piasy' -def publishVersion = '0.2.2' +def publishVersion = '0.2.3' group = publishGroup version = publishVersion diff --git a/buildSrc/src/main/groovy/com/github/piasy/okbuck/OkBuckGradlePlugin.groovy b/buildSrc/src/main/groovy/com/github/piasy/okbuck/OkBuckGradlePlugin.groovy index 5bae7e48b..6bcac47dd 100644 --- a/buildSrc/src/main/groovy/com/github/piasy/okbuck/OkBuckGradlePlugin.groovy +++ b/buildSrc/src/main/groovy/com/github/piasy/okbuck/OkBuckGradlePlugin.groovy @@ -59,31 +59,34 @@ class OkBuckGradlePlugin implements Plugin { } Task okBuck = project.task('okbuck') - dependsOnBundleRelease(okBuck, project) + dependsOnBuild(okBuck, project) okBuck.dependsOn(okBuckClean) okBuck << { applyWithBuildVariant(project, "release") } Task okBuckDebug = project.task('okbuckDebug') - dependsOnBundleRelease(okBuckDebug, project) + dependsOnBuild(okBuckDebug, project) okBuckDebug.dependsOn(okBuckClean) okBuckDebug << { applyWithBuildVariant(project, "debug") } Task okBuckRelease = project.task('okbuckRelease') - dependsOnBundleRelease(okBuckRelease, project) + dependsOnBuild(okBuckRelease, project) okBuckRelease.dependsOn(okBuckClean) okBuckRelease << { applyWithBuildVariant(project, "release") } } - private static dependsOnBundleRelease(Task task, Project project) { + private static dependsOnBuild(Task task, Project project) { project.getTasksByName("bundleRelease", true).each { bundleRelease -> task.dependsOn(bundleRelease) } + project.getTasksByName("jar", true).each { jar -> + task.dependsOn(jar) + } } private static applyWithBuildVariant(Project project, String variant) {