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?

0

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
Avatar
Permanently deleted user

thank you Jakub, it worked!

0

请先登录再写评论。