diff options
Diffstat (limited to 'src/main/groovy/FlycheckAndroidJavaTask.groovy')
| -rw-r--r-- | src/main/groovy/FlycheckAndroidJavaTask.groovy | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main/groovy/FlycheckAndroidJavaTask.groovy b/src/main/groovy/FlycheckAndroidJavaTask.groovy index e5fd985..4eadb85 100644 --- a/src/main/groovy/FlycheckAndroidJavaTask.groovy +++ b/src/main/groovy/FlycheckAndroidJavaTask.groovy @@ -6,29 +6,32 @@ import org.gradle.api.tasks.compile.JavaCompile class FlycheckAndroidJavaTask extends DefaultTask { FlycheckAndroidJavaTask() { - def generate = project.tasks.findByName('generateDebugSources') - if (generate) { - dependsOn generate - } + dependsOn 'generateDebugSources' } @TaskAction def action() { - project.tasks.matching({ task -> - if (!(task instanceof JavaCompile)) false - return task.name.startsWith('compile') && - (task.name.endsWith('DebugJavaWithJavac') || - task.name.endsWith('DebugUnitTestJavaWithJavac')) - }).each { compile -> + def buildTypes = project.extensions.buildTypes.names + if (buildTypes.isEmpty()) buildTypes = ['debug', 'release'] + def flavors = project.extensions.flavors.names + def configurations = ['', 'UnitTest'] + configurations.each { configuration -> + def name = 'compile' + if (!flavors.isEmpty()) name += flavors.first().capitalize() + if (!buildTypes.isEmpty()) name += buildTypes.first().capitalize() + name += configuration.capitalize() + 'JavaWithJavac' + def compile = project.tasks.findByName(name) + if (compile) { println '***' println 'args=' + compile.options.compilerArgs println 'encoding=' + compile.options.encoding - println 'bootcp=' + compile.options.bootClasspath + println 'bootcp=' + (compile.options.bootClasspath ?: '') println 'cp=' + compile.classpath.asPath println 'source=' + compile.sourceCompatibility println 'target=' + compile.targetCompatibility println 'files=' + compile.inputs.files.asPath println 'output=' + compile.destinationDir } + } } } |
