[jps] Fix exclusion of annotation processor output directories from compilation target IDEA-289095

In most of the cases, generated sources originate from annotation processing and are compiled within the same compiler invocation. IDEA internal compilation targets must not include generated sources. Otherwise, annotation generators will fail.

GitOrigin-RevId: 083d3d6cbaedf327e0ee9dcd8e42bcd6d0604b5d
This commit is contained in:
Nikita.Skvortsov
2025-06-09 09:15:56 +02:00
committed by intellij-monorepo-bot
parent dbd97963c2
commit f0fe1abfdb

View File

@@ -156,7 +156,7 @@ public class ModuleBuildTarget extends JVMModuleBuildTarget<JavaSourceRootDescri
File outputIoDir = ProjectPaths.getAnnotationProcessorGeneratedSourcesOutputDir(myModule, JavaSourceRootType.TEST_SOURCE == sourceRoot.getRootType(), profile);
if (outputIoDir != null) {
Path outputDir = outputIoDir.toPath();
if (sourceRoot.getPath().startsWith(outputDir)) {
if (outputDir.startsWith(sourceRoot.getPath())) {
excludes = FileCollectionFactory.createCanonicalPathSet(excludes);
excludes.add(outputDir);
}