diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2018-02-15 22:28:25 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2018-02-15 22:56:31 +0100 |
| commit | 5ea5ec068a5cd7d4b1328b6c14a34d17ac69f69d (patch) | |
| tree | bfdd4c6a3067fa82bb3cce576f96de426bcfcde7 /src/main/groovy/FlycheckAndroidJavaTask.groovy | |
| parent | 16a80d8a9062d22327c9e0e135aabd1931f949b2 (diff) | |
Generate configurations for all variants
Add new option, flycheck-android-java-variant, if a matching variant
is found the matching configuration is used. If no matching variant
is found the first one is used - same as if you had not set a variant.
Variant is case-sensitive.
Diffstat (limited to 'src/main/groovy/FlycheckAndroidJavaTask.groovy')
| -rw-r--r-- | src/main/groovy/FlycheckAndroidJavaTask.groovy | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/main/groovy/FlycheckAndroidJavaTask.groovy b/src/main/groovy/FlycheckAndroidJavaTask.groovy index 633c445..558981d 100644 --- a/src/main/groovy/FlycheckAndroidJavaTask.groovy +++ b/src/main/groovy/FlycheckAndroidJavaTask.groovy @@ -32,30 +32,33 @@ class FlycheckAndroidJavaTask extends DefaultTask { } variants = variants.sort() def configurations = ['', 'UnitTest'] - configurations.each { configuration -> - def name = 'compile' - name += variants.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 'cp=' + compile.classpath.asPath - println 'source=' + compile.sourceCompatibility - println 'target=' + compile.targetCompatibility - println 'files=' + compile.inputs.files.asPath - println 'output=' + compile.destinationDir + variants.each { variant -> + configurations.each { configuration -> + def name = 'compile' + name += variant.capitalize() + name += configuration.capitalize() + 'JavaWithJavac' + def compile = project.tasks.findByName(name) + if (compile) { + println '***' + println 'variant=' + variant + println 'args=' + compile.options.compilerArgs + println 'encoding=' + compile.options.encoding + 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 + } } - } - def name = 'generate' - name += variants.first().capitalize() + 'Sources' - def generate = project.tasks.findByName(name) - if (generate != null) { - println '!!!' - println generate.path + def name = 'generate' + name += variant.capitalize() + 'Sources' + def generate = project.tasks.findByName(name) + if (generate != null) { + println '!!!' + println generate.path + } } } } |
