Buck integration: Infer should always use the javac out directory when running the analysis from the javac commands

Summary:
public
In the case of Buck, the integration works by using the out directory of javac in order to store the analysis artifacts in the jar file. Making buck call:

  infer -o infer_out -- javac -d classes_out ...

instead of every javac command is having no effect and is the same as Buck running:

  infer -- javac -d classes_out ...

Reviewed By: sblackshear

Differential Revision: D2822642

fb-gh-sync-id: b13e067
master
jrm 9 years ago committed by facebook-github-bot-1
parent 8f8d398a9a
commit 22013a007b

@ -79,9 +79,6 @@ def prepare_build(args):
if args.debug_exceptions: if args.debug_exceptions:
infer_options += ['--debug-exceptions', '--no-filtering'] infer_options += ['--debug-exceptions', '--no-filtering']
if args.infer_out is not None:
infer_options += ['--out', args.infer_out]
# Create a temporary directory as a cache for jar files. # Create a temporary directory as a cache for jar files.
infer_cache_dir = os.path.join(args.infer_out, 'cache') infer_cache_dir = os.path.join(args.infer_out, 'cache')
if not os.path.isdir(infer_cache_dir): if not os.path.isdir(infer_cache_dir):
@ -112,7 +109,7 @@ def prepare_build(args):
dir='.') as infer_script: dir='.') as infer_script:
logging.info('Creating %s' % infer_script.name) logging.info('Creating %s' % infer_script.name)
infer_script.file.write( infer_script.file.write(
(INFER_SCRIPT.format(sys.executable, infer)).encode()) INFER_SCRIPT.format(sys.executable, infer).encode())
st = os.stat(infer_script.name) st = os.stat(infer_script.name)
os.chmod(infer_script.name, st.st_mode | stat.S_IEXEC) os.chmod(infer_script.name, st.st_mode | stat.S_IEXEC)

Loading…
Cancel
Save