Always use the current directory as the default classpath

Summary:
public
When no classpath was specified, Infer were considering it to be None instead of the current directory. The consequence is that we were replacing the current directory with the annotation processor for suppress warnings, leading to cases where `javac` was compiling fine but `infer -- javac` was failing with classes not found compilation issues. This diff fixes by always having at least "." in the classpath.

Reviewed By: sblackshear

Differential Revision: D2853035

fb-gh-sync-id: e69db7c
master
jrm 9 years ago committed by facebook-github-bot-7
parent 9c03a6b14c
commit 2e7956f384

@ -23,7 +23,8 @@ current_directory = os.getcwd()
parser.add_argument('-version', action='store_true')
parser.add_argument('-deprecation', action='store_true')
parser.add_argument('-cp', '-classpath', type=str, dest='classpath')
parser.add_argument('-cp', '-classpath', type=str,
dest='classpath', default=os.getcwd())
parser.add_argument('-bootclasspath', type=str)
parser.add_argument('-d', dest='classes_out', default=current_directory)
parser.add_argument('-processorpath', type=str, dest='processorpath')
@ -74,14 +75,10 @@ class CompilerCall:
self.args.processorpath])
javac_cmd += ['-processorpath', processorpath]
else:
if classpath is not None:
classpath = os.pathsep.join([config.ANNOT_PROCESSOR_JAR,
classpath])
else:
classpath = config.ANNOT_PROCESSOR_JAR
if classpath is not None:
javac_cmd += ['-classpath', classpath]
classpath = os.pathsep.join([config.ANNOT_PROCESSOR_JAR,
classpath])
javac_cmd += ['-classpath', classpath]
# this overrides the default mechanism for discovering annotation
# processors (checking the manifest of the annotation processor

Loading…
Cancel
Save