Set `--system` in JavaExtractor
@@ -136,11 +136,17 @@ public class JavaExtractor {
Files.createDirectories(genSrcDir.get());
}
- // TODO(salguarnieri) Read -system module directory from the javac arguments.
- CompilationDescription description =
+ JavaCompilationUnitExtractor javaCompilationUnitExtractor =
new JavaCompilationUnitExtractor(FileVNames.fromFile(vNamesConfigPath), USER_DIR.value())
- .setAllowServiceProcessors(false) // Bazel provides any necessary processors
- .extract(
+ .setAllowServiceProcessors(false); // Bazel provides any necessary processors
+
+ String sysd = jInfo.getSystem();
+ if (!sysd.isEmpty() && !sysd.equals("none")) {
+ javaCompilationUnitExtractor.useSystemDirectory(sysd);
+ }
+
+ CompilationDescription description =
+ javaCompilationUnitExtractor.extract(
info.getOwner(),
sources,
jInfo.getClasspathList(),
