IDEA module should be smart about build directory

The IDEA module is smart about adding the project’s build directory as an exclusion directory when buliding the .iml file.

However, it is very common when doing various kinds of preprocessing (such as CoffeeScript compilation) to output into a sub-folder of the build directory. I then need some boilerplate to have the new folder appear:

  idea.module.iml.whenMerged { module ->

module.excludeFolders.removeAll {

 it.canonicalUrl.endsWith "/build"

}  }  

Ideally, the IdeaModule task would be smart enough to exclude each folder under build, except for those that are explicitly in the SourceSetOutput directory list.

Should have checked my work; the above was based on one approach I’ve made to compiling CoffeeScript; however using the SourceSetOutput approach adds the directory as a library, not a source root, and the build folder exclusion is not needed.

Given your second response, I’m not quite clear on the change you’re proposing (if any).