diff options
| author | Joel Klinghed <the_jk@opera.com> | 2017-09-20 15:36:41 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2017-09-20 15:36:41 +0200 |
| commit | 1bb1faccaa0e921a5f856de1bd02c4c53f3348f9 (patch) | |
| tree | 24233cb440f2e42346e147f9aabfa0ba8eb7f314 | |
| parent | 0e8701f46dc29912f1bbc0b460f47e7802eb572a (diff) | |
Support projects using productFlavors
| -rw-r--r-- | README | 2 | ||||
| -rw-r--r-- | build.gradle | 2 | ||||
| -rw-r--r-- | src/main/groovy/FlycheckAndroidJavaTask.groovy | 12 |
3 files changed, 8 insertions, 8 deletions
@@ -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 } - } } } |
