Skip to content

Commit

Permalink
Fixes #42908
Browse files Browse the repository at this point in the history
(cherry picked from commit 0580edf)
  • Loading branch information
KERN Christian authored and gsmet committed Sep 10, 2024
1 parent 6789f02 commit e557f13
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ protected QuarkusFileManager(StandardJavaFileManager fileManager, Context contex
this.fileManager.setLocation(StandardLocation.SOURCE_OUTPUT, List.of(context.getGeneratedSourcesDirectory()));
}
if (context.getAnnotationProcessorPaths() != null) {
// Paths might be missing! (see: https://github.com/quarkusio/quarkus/issues/42908)
ensureDirectories(context.getAnnotationProcessorPaths());
this.fileManager.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, context.getAnnotationProcessorPaths());
}
} catch (IOException e) {
Expand All @@ -39,12 +41,22 @@ public void reset(Context context) {
this.fileManager.setLocation(StandardLocation.SOURCE_OUTPUT, List.of(context.getGeneratedSourcesDirectory()));
}
if (context.getAnnotationProcessorPaths() != null) {
// Paths might be missing! (see: https://github.com/quarkusio/quarkus/issues/42908)
ensureDirectories(context.getAnnotationProcessorPaths());
this.fileManager.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, context.getAnnotationProcessorPaths());
}
} catch (IOException e) {
throw new RuntimeException("Cannot reset file manager", e);
}
}

private void ensureDirectories(Iterable<File> directories){
for (File processorPath : directories) {
if (!processorPath.exists()) {
processorPath.mkdirs();
}
}
}

@Override
public void close() throws IOException {
Expand Down

0 comments on commit e557f13

Please sign in to comment.