Cardea (IJ 13) gradle + custom source sets

Hi community,

is there a way to tell Cardea (V132.637) that there are additional source sets?

My build.gradle contains

configurations {
    integrationTestCompile { extendsFrom testCompile }
    integrationTestRuntime { extendsFrom testRuntime }

dependencies {
    integrationTestCompile sourceSets.main.output
    integrationTestCompile configurations.testCompile
    integrationTestCompile sourceSets.test.output
    integrationTestRuntime configurations.testRuntime
. Until now, I was using the gradle-idea-plugin which added the required configuration to the iml files using the following snippet

apply plugin: idea

idea {
    module {
        testSourceDirs += file('src/integrationTest/java')
        testSourceDirs += file('src/integrationTest/resources') += configurations.integrationTestCompile += configurations.integrationTestRuntime

How do I do that with jetgradle/IntelliJ 13?


I created for this problem since even using the sample from the gradle distribution does not work.


Hi Sascha,

IJ Gradle plugin uses Gradle Tooling API to get project information. Unfortunately the API doesn't expose information about custom source sets.
And, since the plugin uses Gradle build scripts as a "single source of truth" - manual changes will be overwritten on later "refresh".

There is already related ticket at Gradle tracking system, you may vote for it -



Hi Vlad,

thanks for the response. It is hard to believe that this is not possible ... it more or less renders the shiny IntelliJ + Gradle Integration useless for a lot of projects. So we have to revert to the gradle-intellij-plugin.
I added my vote to GRADLE-2680 and hope it is fixed soon.



For completeness: Now it works, as Vlad explained in the issue (

Vlad, does this render the gradle issue ( obsolete? We should comment accordingly over there.


The gradle issue does not fixed yet, IJ uses init script with dynamic plugin applied to get extended information about the project.
So, yes, it's not a blocker for anymore but it would be better to have it fixed in Gradle Tooling API too.


Please sign in to leave a comment.