[config] Pass classpath via CLOpt.args_env_var

Reviewed By: jvillard

Differential Revision: D4114501

fbshipit-source-id: 293341a
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent b7675dd2a2
commit cf657b0e53

@ -207,12 +207,6 @@ class AnalyzerWrapper(object):
exit_status = os.EX_OK
if self.javac is not None and self.args.buck:
if self.javac.args.classpath is not None:
for path in self.javac.args.classpath.split(os.pathsep):
if os.path.isfile(path):
infer_options += ['-ziplib', os.path.abspath(path)]
infer_options = map(utils.decode_or_not, infer_options)
infer_options_str = ' '.join(infer_options)
os.environ['INFER_OPTIONS'] = utils.encode(infer_options_str)

@ -273,6 +273,16 @@ class AnalyzerWithFrontendWrapper(analyze.AnalyzerWrapper):
if self.args.analyzer == config.ANALYZER_CAPTURE:
return os.EX_OK
if self.args.buck:
if self.javac.args.classpath is not None:
infer_args = utils.read_env()['INFER_ARGS']
# 'INFER_ARGS' must be CommandLineOption.args_env_var
for path in self.javac.args.classpath.split(os.pathsep):
if os.path.isfile(path):
infer_args += '^--specs-library^' + os.path.abspath(path)
# '^' must be CommandLineOption.env_var_sep
os.environ['INFER_ARGS'] = utils.encode(infer_args)
self.analyze_and_report()
self._close()
self.timing['total'] = utils.elapsed_time(start_time)

@ -1132,7 +1132,6 @@ and spec_abs_level =
and specs_library =
let specs_library =
CLOpt.mk_string_list ~long:"specs-library" ~short:"lib" ~f:resolve
~deprecated:["-zip-specs-library"; "ziplib"]
~meta:"dir|jar" "Search for .spec files in given directory or jar file" in
let _ =
(* Given a filename with a list of paths, convert it into a list of string iff they are

Loading…
Cancel
Save