diff options
| -rw-r--r-- | bin/flycheck-android-java.py | 24 | ||||
| -rw-r--r-- | src/main/groovy/FlycheckAndroidJavaTask.groovy | 9 |
2 files changed, 28 insertions, 5 deletions
diff --git a/bin/flycheck-android-java.py b/bin/flycheck-android-java.py index ae52fe7..d4a54ca 100644 --- a/bin/flycheck-android-java.py +++ b/bin/flycheck-android-java.py @@ -147,8 +147,8 @@ def figure_out_java_compilation(sessiondir, sourcefile, tempfile, checkstyle, outdir = None if not output: - cmd.extend(['-q', 'flycheckAndroidJava']) - output = subprocess.check_output(cmd, universal_newlines=True) + flycheck_cmd = cmd + ['-q', 'flycheckAndroidJava'] + output = subprocess.check_output(flycheck_cmd, universal_newlines=True) if sessiondir != None: try: with open(cachefile, 'w') as f: @@ -157,12 +157,28 @@ def figure_out_java_compilation(sessiondir, sourcefile, tempfile, checkstyle, pass output = output.split('\n') + + generate = None + all_generate = [] + + for line in output: + if line == '***' or line == '!!!': + if generate: + all_generate.extend(generate) + + generate = [] if line == '!!!' else None + elif generate != None: + generate.append(line) + + if all_generate: + subprocess.call(cmd + ['-q'] + all_generate) + data = None first = None ret = 0 compiled = False for line in output: - if line == '***': + if line == '***' or line == '!!!': if data: if not first: first = data @@ -174,7 +190,7 @@ def figure_out_java_compilation(sessiondir, sourcefile, tempfile, checkstyle, data['args'], tempfile, outdir) compiled = True break - data = {} + data = {} if line == '***' else None elif data != None: if line.startswith('args='): data['args'] = line[6:-1].split(', ') diff --git a/src/main/groovy/FlycheckAndroidJavaTask.groovy b/src/main/groovy/FlycheckAndroidJavaTask.groovy index d7ce2da..633c445 100644 --- a/src/main/groovy/FlycheckAndroidJavaTask.groovy +++ b/src/main/groovy/FlycheckAndroidJavaTask.groovy @@ -6,7 +6,6 @@ import org.gradle.api.tasks.compile.JavaCompile class FlycheckAndroidJavaTask extends DefaultTask { FlycheckAndroidJavaTask() { - dependsOn 'generateDebugSources' } @TaskAction @@ -50,5 +49,13 @@ class FlycheckAndroidJavaTask extends DefaultTask { 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 + } } } |
