[infer][java] remove the temporary file created to store the list of Buck targets

Reviewed By: sblackshear

Differential Revision: D5056897

fbshipit-source-id: 1d0a233
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent abc5642c83
commit 1fbc4a1b22

@ -230,11 +230,13 @@ class Wrapper:
self.buck_args = buck_args
self.normalized_targets = get_normalized_targets(
buck_args.targets)
self.temp_files = []
# write targets to file to avoid passing too many command line args
with tempfile.NamedTemporaryFile(delete=False,
prefix='targets_') as targets_file:
targets_file.write('\n'.join(self.normalized_targets))
self.buck_cmd = base_cmd + ['@%s' % targets_file.name]
self.temp_files.append(targets_file.name)
self.timer.stop('%d targets computed', len(self.normalized_targets))
def _collect_results(self, start_time):
@ -243,7 +245,6 @@ class Wrapper:
self.timer.stop('Done')
def run(self):
temp_files = []
start_time = time.time()
try:
logging.info('Starting the analysis')
@ -253,7 +254,7 @@ class Wrapper:
self.timer.start('Preparing build ...')
temp_files2, infer_script = prepare_build(self.infer_args)
temp_files += temp_files2
self.temp_files += temp_files2
self.timer.stop('Build prepared')
if len(self.normalized_targets) == 0:
@ -280,4 +281,4 @@ class Wrapper:
return os.EX_OK
raise e
finally:
cleanup(temp_files)
cleanup(self.temp_files)

Loading…
Cancel
Save