[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
master
jrm 9 years ago
parent bb59bb04b7
commit 2468139fb7

@ -187,7 +187,7 @@ def create_results_dir(results_dir):
def clean_infer_out(infer_out): def clean_infer_out(infer_out):
directories = ['multicore', 'classnames', 'sources', 'filelists'] directories = ['multicore', 'classnames', 'sources', jwlib.FILELISTS]
extensions = ['.cfg', '.cg'] extensions = ['.cfg', '.cg']
for root, dirs, files in os.walk(infer_out): for root, dirs, files in os.walk(infer_out):

@ -12,6 +12,8 @@ import tempfile
import subprocess import subprocess
import utils import utils
FILELISTS = 'filelists'
# javac options # javac options
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()

@ -5,10 +5,10 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
import jwlib
import logging
import os import os
import util import util
import logging
import subprocess
import tempfile import tempfile
MODULE_NAME = __name__ MODULE_NAME = __name__
@ -19,7 +19,7 @@ Analysis examples:
infer -- gradle build infer -- gradle build
infer -- ./gradlew build''' infer -- ./gradlew build'''
FILELISTS = 'filelists'
def gen_instance(*args): def gen_instance(*args):
return GradleCapture(*args) return GradleCapture(*args)
@ -37,7 +37,7 @@ class GradleCapture:
self.build_cmd = [cmd[0], '--debug'] + cmd[1:] self.build_cmd = [cmd[0], '--debug'] + cmd[1:]
# That contains javac version as well # That contains javac version as well
version_str = util.run_cmd_ignore_fail([cmd[0], '--version']) 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): if not os.path.exists(path):
os.mkdir(path) os.mkdir(path)
logging.info("Running with:\n" + version_str) logging.info("Running with:\n" + version_str)
@ -60,7 +60,7 @@ class GradleCapture:
mode='w', mode='w',
suffix='.txt', suffix='.txt',
prefix='gradle_', 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: delete=False) as sources:
sources.write("\n".join(java_files)) sources.write("\n".join(java_files))
sources.flush() sources.flush()

Loading…
Cancel
Save