Configuring source jars for gradle dependencies


Is there a way to configure source jars for dependencies from the gradle build files when using IntelliJs import?

For Eclipse/Buildship I do the following in build.gradle because Buildship uses the eclipse dsl in the gradle files:

apply plugin: 'eclipse'
apply plugin: 'java'

dependencies {
compile group: "somegroup", name: 'stuff'
testCompile group: "somegroup", name: 'stuff', classifier: "test"

repositories {
flatDir name: "flatdir-repo", dir: "stuffimports/"

eclipse {
classpath {
file {
whenMerged {
def libs = entries.findAll { it.path ==~ /.+stuff(|-test)\.jar$/ }
libs.each {
it.sourcePath = fileReference(file(it.path.replaceAll(/\.jar/, /-src.jar/)))

Basically: Is there any documentation on how/if the IntelliJs "Import existing module from Gradle" interacts with Gradle's 'idea' plugin? Or any good examples? and doesn't say anything about this.



Is there any documentation on how IntelliJ's Gradle import interacts with the Gradle's 'idea' plugin?


Is there any work being done at improving this integration?

I have seen that the gradle team is looking at being able to opening gradle itself directly instead of needing to use the gradle idea plugin.


For anyone finding this via search, I created

EDIT: Was wrong link, fixed.


Please sign in to leave a comment.