From 1bb1faccaa0e921a5f856de1bd02c4c53f3348f9 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 20 Sep 2017 15:36:41 +0200 Subject: Support projects using productFlavors --- README | 2 +- build.gradle | 2 +- src/main/groovy/FlycheckAndroidJavaTask.groovy | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README b/README index 4cb9ab1..87547ab 100644 --- a/README +++ b/README @@ -44,7 +44,7 @@ initscript { } } dependencies { - classpath 'org.thejk:flycheck-android-experimental:0.3.2' + classpath 'org.thejk:flycheck-android-experimental:0.3.4' } } diff --git a/build.gradle b/build.gradle index 8a1b3aa..b2ee96d 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ dependencies { apply plugin: 'maven' group = 'org.thejk' -version = '0.3.3' +version = '0.3.4' uploadArchives { repositories { diff --git a/src/main/groovy/FlycheckAndroidJavaTask.groovy b/src/main/groovy/FlycheckAndroidJavaTask.groovy index 4984d69..e5fd985 100644 --- a/src/main/groovy/FlycheckAndroidJavaTask.groovy +++ b/src/main/groovy/FlycheckAndroidJavaTask.groovy @@ -14,11 +14,12 @@ class FlycheckAndroidJavaTask extends DefaultTask { @TaskAction def action() { - def tasks = ['compileDebugJavaWithJavac', - 'compileDebugUnitTestJavaWithJavac'] - for (String task : tasks) { - def compile = project.tasks.findByName(task) - if (compile instanceof JavaCompile) { + project.tasks.matching({ task -> + if (!(task instanceof JavaCompile)) false + return task.name.startsWith('compile') && + (task.name.endsWith('DebugJavaWithJavac') || + task.name.endsWith('DebugUnitTestJavaWithJavac')) + }).each { compile -> println '***' println 'args=' + compile.options.compilerArgs println 'encoding=' + compile.options.encoding @@ -29,6 +30,5 @@ class FlycheckAndroidJavaTask extends DefaultTask { println 'files=' + compile.inputs.files.asPath println 'output=' + compile.destinationDir } - } } } -- cgit v1.2.3-70-g09d2