|
60 | 60 |
|
61 | 61 | public class JavacUtils { |
62 | 62 |
|
63 | | - public static void configureJavacContext(Context context, Map<String, String> compilerOptions, IJavaProject javaProject, boolean isTest) { |
64 | | - configureJavacContext(context, compilerOptions, javaProject, null, null, isTest); |
| 63 | + public static void configureJavacContext(Context context, Map<String, String> compilerOptions, IJavaProject javaProject, boolean isTest, boolean skipModules) { |
| 64 | + configureJavacContext(context, compilerOptions, javaProject, null, null, isTest, skipModules); |
65 | 65 | } |
66 | 66 |
|
67 | 67 | public static void configureJavacContext(Context context, JavacConfig compilerConfig, |
68 | 68 | IJavaProject javaProject, File output, boolean isTest) { |
69 | | - configureJavacContext(context, compilerConfig.compilerOptions().getMap(), javaProject, compilerConfig, output, isTest); |
| 69 | + configureJavacContext(context, compilerConfig.compilerOptions().getMap(), javaProject, compilerConfig, output, isTest, false); |
70 | 70 | } |
71 | 71 |
|
72 | 72 | private static void configureJavacContext(Context context, Map<String, String> compilerOptions, |
73 | | - IJavaProject javaProject, JavacConfig compilerConfig, File output, boolean isTest) { |
| 73 | + IJavaProject javaProject, JavacConfig compilerConfig, File output, boolean isTest, boolean skipModules) { |
74 | 74 | IClasspathEntry[] classpath = new IClasspathEntry[0]; |
75 | 75 | if (javaProject != null && javaProject.getProject() != null) { |
76 | 76 | try { |
@@ -103,7 +103,7 @@ private static void configureJavacContext(Context context, Map<String, String> c |
103 | 103 | JavacFileManager.preRegister(context); |
104 | 104 | } |
105 | 105 | if (javaProject instanceof JavaProject internal) { |
106 | | - configurePaths(internal, context, compilerConfig, output, isTest); |
| 106 | + configurePaths(internal, context, compilerConfig, output, isTest, skipModules); |
107 | 107 | } |
108 | 108 | } |
109 | 109 |
|
@@ -228,7 +228,7 @@ private static void addDebugInfos(Map<String, String> compilerOptions, Options o |
228 | 228 | } |
229 | 229 |
|
230 | 230 | private static void configurePaths(JavaProject javaProject, Context context, JavacConfig compilerConfig, |
231 | | - File output, boolean isTest) { |
| 231 | + File output, boolean isTest, boolean skipModules) { |
232 | 232 | var fileManager = (StandardJavaFileManager)context.get(JavaFileManager.class); |
233 | 233 | try { |
234 | 234 | if (compilerConfig != null && !isEmpty(compilerConfig.annotationProcessorPaths())) { |
@@ -338,7 +338,7 @@ private static void configurePaths(JavaProject javaProject, Context context, Jav |
338 | 338 | classpathFiles.addAll(outDirectories(javaProject, entry -> isTest || !entry.isTest())); |
339 | 339 | fileManager.setLocation(StandardLocation.CLASS_PATH, classpathFiles); |
340 | 340 |
|
341 | | - if (!moduleSourcePathEnabled && javaProject.getModuleDescription() != null) { |
| 341 | + if (!skipModules && !moduleSourcePathEnabled && javaProject.getModuleDescription() != null) { |
342 | 342 | moduleProjects = new LinkedHashSet<>(moduleProjects); |
343 | 343 | moduleProjects.add(javaProject); |
344 | 344 | for (IJavaProject requiredModuleProject : moduleProjects) { |
|
0 commit comments