[infer][java] add the bootclasspath command line option to the genrule tests

Summary: Without this option, the frontend would fail to retrieve the type definition for the classes in the standard library, e.g. java.lang.String. Those failures are currently swallowed but the plan is to fail hard whenever the translation needs the definition of a class and is unable to find it as this should generally caused by some intergation bug with the build system.

Reviewed By: sblackshear

Differential Revision: D5770061

fbshipit-source-id: 20bad8f
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent d0d78aae7b
commit 045bec3863

@ -39,6 +39,7 @@ def create_genrules(
if 'GENERATE_INFER_GENRULES' in os.environ and srcs: if 'GENERATE_INFER_GENRULES' in os.environ and srcs:
for analyzer in analyzers: for analyzer in analyzers:
analyzer_name = name + '_{}'.format(analyzer) analyzer_name = name + '_{}'.format(analyzer)
bootclasspath = os.path.join(os.environ['JAVA_HOME'], 'jre', 'lib', 'rt.jar')
genrule( genrule(
name = analyzer_name, name = analyzer_name,
srcs=srcs, srcs=srcs,
@ -47,6 +48,7 @@ def create_genrules(
'-a', analyzer, '-a', analyzer,
'--results-dir', '$OUT', '--results-dir', '$OUT',
'--classpath', '$(classpath :{})'.format(name), '--classpath', '$(classpath :{})'.format(name),
'--bootclasspath', bootclasspath,
'--sourcepath', '$SRCDIR', '--sourcepath', '$SRCDIR',
'--generated-classes', '$(location :{})'.format(name), '--generated-classes', '$(location :{})'.format(name),
]), ]),

Loading…
Cancel
Save