Mark directory as excluded programmatically
已回答
I am creating a plugin that creates a folder the project root dir, but I want that folder to be excluded automatically. Is there a way to do it programmatically?
请先登录再写评论。
Jorge,
The best way to solve it is by adding such file as excluded on a module level using ContentEntry#addExcludeFolder(VirtualFile) i.e.:
ModuleRootModificationUtil.updateModel(myModule) { model ->runReadAction {
findContentEntry(model, outDir)?.addExcludeFolder(outDir)
}
}
thank you Jakub, it worked!