From 4e2cc84bcbeb110b9efb59e45d3c7d4c90f768b0 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 19 Aug 2016 06:14:16 -0700 Subject: [PATCH] compile *.java files only Summary: Infer's mvn integration would collect *all* files in `src_roots` and pass them to `javac`. But these folders may contain non-Java files. Filter out any file that doesn't end in `.java`. closes #401 closes #418 closes #442 Reviewed By: martinoluca Differential Revision: D3741893 fbshipit-source-id: 5c489f9 --- infer/lib/python/inferlib/capture/mvn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infer/lib/python/inferlib/capture/mvn.py b/infer/lib/python/inferlib/capture/mvn.py index 231515694..44abba423 100644 --- a/infer/lib/python/inferlib/capture/mvn.py +++ b/infer/lib/python/inferlib/capture/mvn.py @@ -60,7 +60,9 @@ class MavenCapture: for src_root in src_roots: for root, dirs, files in os.walk(src_root): for name in files: - files_to_compile.append(os.path.join(root, name)) + if name.endswith(".java"): + path = os.path.join(root, name) + files_to_compile.append(path) source_roots_next = False elif options_pattern in line: