From cb52bff3660911b618695d024c7a15e129779aa6 Mon Sep 17 00:00:00 2001 From: jrm Date: Thu, 20 Aug 2015 11:04:32 -0700 Subject: [PATCH] [infer][java] Extract the information about classpath from the javac commands so that the classpath can be modified when running the analysis Summary: In order to use the annotation processor to detect the classes and methods annotated with `@SuppressWarnings`, we need to modified javac commands of the form: javac -cp classpath File.java into: javac -cp annotations/processor.jar:classpath File.java This diff is just a non-functional re-factoring step. --- infer/bin/jwlib.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/infer/bin/jwlib.py b/infer/bin/jwlib.py index 756b49ca7..dd2c87f3f 100644 --- a/infer/bin/jwlib.py +++ b/infer/bin/jwlib.py @@ -30,14 +30,21 @@ class CompilerCall: def __init__(self, arguments): self.original_arguments = arguments - self.args, _ = parser.parse_known_args(arguments) + self.args, self.remaining_args = parser.parse_known_args(arguments) self.verbose_out = None def run(self): if self.args.version: return subprocess.call(['javac'] + self.original_arguments) else: - javac_cmd = ['javac', '-verbose', '-g'] + self.original_arguments + javac_cmd = ['javac', '-verbose', '-g'] + if self.args.bootclasspath is not None: + javac_cmd += ['-bootclasspath', self.args.bootclasspath] + if self.args.classpath is not None: + javac_cmd += ['-cp', self.args.classpath] + if self.args.classes_out is not None: + javac_cmd += ['-d', self.args.classes_out] + javac_cmd += self.remaining_args javac_cmd.append('-J-Duser.language=en') with tempfile.NamedTemporaryFile(