From 6f0c4cda4ab2eea99c989893d7b6f1a609ad88e0 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Mon, 9 Oct 2017 12:11:53 -0700 Subject: [PATCH] [infer][java] disable the cache of specs files used to speed up the analysis of Buck Java projects Reviewed By: sblackshear Differential Revision: D5970627 fbshipit-source-id: 2f616d6 --- infer/lib/python/inferlib/bucklib.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/infer/lib/python/inferlib/bucklib.py b/infer/lib/python/inferlib/bucklib.py index 0829c5730..c753776c0 100644 --- a/infer/lib/python/inferlib/bucklib.py +++ b/infer/lib/python/inferlib/bucklib.py @@ -32,6 +32,8 @@ DEFAULT_BUCK_OUT_GEN = os.path.join(DEFAULT_BUCK_OUT, 'gen') INFER_JSON_REPORT = os.path.join(config.BUCK_INFER_OUT, config.JSON_REPORT_FILENAME) +USE_INFER_CACHE = False + INFER_SCRIPT = """\ #!/usr/bin/env {python_executable} import subprocess @@ -55,12 +57,14 @@ def prepare_build(args): args.java_jar_compiler, ] - # Create a temporary directory as a cache for jar files. - infer_cache_dir = os.path.join(args.infer_out, 'cache') - if not os.path.isdir(infer_cache_dir): - os.mkdir(infer_cache_dir) - infer_options += ['--infer-cache', infer_cache_dir] - temp_files = [infer_cache_dir] + temp_files = [] + if USE_INFER_CACHE: + # Create a temporary directory as a cache for jar files. + infer_cache_dir = os.path.join(args.infer_out, 'cache') + if not os.path.isdir(infer_cache_dir): + os.mkdir(infer_cache_dir) + infer_options += ['--infer-cache', infer_cache_dir] + temp_files += [infer_cache_dir] try: infer_command = [utils.get_cmd_in_bin_dir('infer')] + infer_options