Noel Yap
Noel Yap

Reputation: 19778

How to get `gradlew idea` to get IDEA to use test conf for custom task?

I have the following:

sourceSets {
    integrationTest {
        java.srcDir file('.')
    }
}

dependencies {
    integrationTestCompile project(':sut-project')
}

task integrationTest(type: Test)

but when gradlew idea is run and the project opened, the Sources doesn't have a Tests conf for that project.

What needs to be done to get this to work?

Upvotes: 1

Views: 3685

Answers (1)

Radim
Radim

Reputation: 4808

The documentation for IDEA plugin is at http://www.gradle.org/docs/current/userguide/idea_plugin.html

From this links you can navigate to http://www.gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html where you can see how to map additional source roots (AKA content-roots in IntelliJ parlance) to your modules and configurations to classpath using proper scope. You will use something like:

idea { module { testSourceDirs += file('src/integTest/java') scopes.TEST.plus += configurations.integrationTestCompile } }

Upvotes: 2

Related Questions