Search code examples
intellij-ideagradlesource-sets

Whats wrong with this that causes my integration tests to be marked as source rather than test source?


This works fine from the command line but IntelliJ displays the integrationTest sources as if they were source and not test source.

Gradle code:

sourceSets {
    integrationTest {
        java {
            compileClasspath += main.output + test.output
            runtimeClasspath += main.output + test.output
            srcDir file('src/it/java')
            output.classesDir   = "$buildDir/classes/it"
        }

        def resourceDir = file('src/it/resources')
        if (resourceDir.exists()) {
            resources.srcDir resourceDir
            output.resourcesDir = "$buildDir/resources/it"
        }
    }
}

Solution

  • It's an IntelliJ bug. Please vote for it.

    https://youtrack.jetbrains.com/issue/IDEA-151925