Mark directory as excluded programmatically
Answered
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?
Please sign in to leave a comment.
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!