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 /src/main/groovy/FlycheckAndroidJavaTask.groovy | |
| parent | 0e8701f46dc29912f1bbc0b460f47e7802eb572a (diff) | |
Support projects using productFlavors
Diffstat (limited to 'src/main/groovy/FlycheckAndroidJavaTask.groovy')
| -rw-r--r-- | src/main/groovy/FlycheckAndroidJavaTask.groovy | 12 |
1 files changed, 6 insertions, 6 deletions
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 } - } } } |
