From 2468139fb756469216c920652f577336c63c2e8d Mon Sep 17 00:00:00 2001 From: jrm Date: Wed, 12 Aug 2015 09:32:18 -0700 Subject: [PATCH] [infer][java] move the Gradle filelist directory definition in one place Summary: Just move in a single place the definition of the sub-directory where the files containing the source file lists passed to javac --- infer/bin/inferlib.py | 2 +- infer/bin/jwlib.py | 2 ++ infer/lib/capture/gradle.py | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/infer/bin/inferlib.py b/infer/bin/inferlib.py index b97d3500d..8ee9cb403 100644 --- a/infer/bin/inferlib.py +++ b/infer/bin/inferlib.py @@ -187,7 +187,7 @@ def create_results_dir(results_dir): def clean_infer_out(infer_out): - directories = ['multicore', 'classnames', 'sources', 'filelists'] + directories = ['multicore', 'classnames', 'sources', jwlib.FILELISTS] extensions = ['.cfg', '.cg'] for root, dirs, files in os.walk(infer_out): diff --git a/infer/bin/jwlib.py b/infer/bin/jwlib.py index 46f36902c..756b49ca7 100644 --- a/infer/bin/jwlib.py +++ b/infer/bin/jwlib.py @@ -12,6 +12,8 @@ import tempfile import subprocess import utils +FILELISTS = 'filelists' + # javac options parser = argparse.ArgumentParser() diff --git a/infer/lib/capture/gradle.py b/infer/lib/capture/gradle.py index 4967542de..835dd10a9 100644 --- a/infer/lib/capture/gradle.py +++ b/infer/lib/capture/gradle.py @@ -5,10 +5,10 @@ # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. +import jwlib +import logging import os import util -import logging -import subprocess import tempfile MODULE_NAME = __name__ @@ -19,7 +19,7 @@ Analysis examples: infer -- gradle build infer -- ./gradlew build''' -FILELISTS = 'filelists' + def gen_instance(*args): return GradleCapture(*args) @@ -37,7 +37,7 @@ class GradleCapture: self.build_cmd = [cmd[0], '--debug'] + cmd[1:] # That contains javac version as well version_str = util.run_cmd_ignore_fail([cmd[0], '--version']) - path = os.path.join(self.args.infer_out, FILELISTS) + path = os.path.join(self.args.infer_out, jwlib.FILELISTS) if not os.path.exists(path): os.mkdir(path) logging.info("Running with:\n" + version_str) @@ -60,7 +60,7 @@ class GradleCapture: mode='w', suffix='.txt', prefix='gradle_', - dir=os.path.join(self.args.infer_out, FILELISTS), + dir=os.path.join(self.args.infer_out, jwlib.FILELISTS), delete=False) as sources: sources.write("\n".join(java_files)) sources.flush()