Skip to content

Commit

Permalink
fix #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Piasy committed Oct 6, 2015
1 parent a808460 commit 0e1712f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,34 @@ class OkBuckGradlePlugin implements Plugin<Project> {
}

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) {
Expand Down

0 comments on commit 0e1712f

Please sign in to comment.