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?

2 comments
Comment actions Permalink

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)
}
}
0
Comment actions Permalink

thank you Jakub, it worked!

0

Please sign in to leave a comment.