Can I get IDEA to run my generateSources task during import of a Gradle project?

So far I've only tried this with IDEA 13.  I have a couple tasks in my Gradle build that generate source code (ex: Apache Thrift).  Is there a way I can get IDEA to run my tasks that generate sources during the initial import of a project?  I thought I could do the following, but it doesn't work:

afterEvaluate {     if(plugins.hasPlugin("idea")) {         ideaModule.dependsOn generateSources     }     compileJava.dependsOn generateSources }


I have to manually run my generateSources task and then everything works ok.

Any tips?

Please sign in to leave a comment.