I have the following in a ‘build.gradle’ file:
subprojects { subproject ->
idea {
module {
name = “${subproject.parent.name}-${subproject.name}”
testSourceDirs += file(‘java’)
scopes.TEST.plus += configurations[compileConfigurationName]
}
}
}
If ‘name’ field isn’t specified (or if it’s specified to be what it’ll default to), the following is placed in the ‘.iml’ file:
Otherwise, it produces:
The following works around the problem:
idea {
module {
name = “${subproject.parent.name}-${subproject.name}”
scopes.TEST.plus += configurations[compileConfigurationName]
iml {
whenMerged { m ->
m.testSourceFolders += new org.gradle.plugins.ide.idea.model.Path(‘file://$MODULE_DIR$/java’)
}
}
}
}
We’re using Gradle 1.12-20140612154955+0000.