@@ -128,6 +128,7 @@ public static List<File> getClasspath(SourceSetReference reference, Project proj
128
128
final List <File > classpath = getGradleClasspath (reference , project );
129
129
130
130
classpath .addAll (getIdeaClasspath (reference , project ));
131
+ classpath .addAll (getIdeaModuleCompileOutput (reference ));
131
132
classpath .addAll (getEclipseClasspath (reference , project ));
132
133
classpath .addAll (getVscodeClasspath (reference , project ));
133
134
@@ -192,6 +193,25 @@ public static List<File> getIdeaClasspath(SourceSetReference reference, Project
192
193
return Collections .singletonList (outputDir );
193
194
}
194
195
196
+ private static List <File > getIdeaModuleCompileOutput (SourceSetReference reference ) {
197
+ final File dotIdea = new File (reference .project ().getRootDir (), ".idea" );
198
+
199
+ if (!dotIdea .exists ()) {
200
+ // Not an intellij project
201
+ return Collections .emptyList ();
202
+ }
203
+
204
+ final String name = reference .sourceSet ().getName ();
205
+ final File projectDir = reference .project ().getProjectDir ();
206
+ final File outDir = new File (projectDir , "out" );
207
+ final File sourceSetOutDir = new File (outDir , name .equals (SourceSet .MAIN_SOURCE_SET_NAME ) ? "production" : name );
208
+
209
+ return List .of (
210
+ new File (sourceSetOutDir , "classes" ),
211
+ new File (sourceSetOutDir , "resources" )
212
+ );
213
+ }
214
+
195
215
@ Nullable
196
216
private static String evaluateXpath (File file , @ Language ("xpath" ) String expression ) {
197
217
final XPath xpath = XPathFactory .newInstance ().newXPath ();
0 commit comments