diff options
| author | Joel Klinghed <the_jk@opera.com> | 2017-12-05 13:30:14 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2017-12-05 13:30:14 +0100 |
| commit | 38167e774934b643338f94201b16a922d80bc448 (patch) | |
| tree | e11c6cbbfc2893f1636e538a6264bfc7824a0a3f /bin | |
| parent | 26bcc8b2e79d655bffe17b323b845cb4f32cc220 (diff) | |
Stop hardcoding generateDebugSources
Instead we write a list of generate tasks to output of flycheckAndroidJava
task and let the pyhton script run them
Reason to do it like this is that when the FlycheckAndroidJava task
is created it's to early to get the list of buildtypes or flavors
from the extensions.
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/flycheck-android-java.py | 24 |
1 files changed, 20 insertions, 4 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(', ') |
