Hello,
I'm trying to use the IDEA plugin with an existing multi-project build
(IDEA 10.0.2 and Gradle 0.9.2). The build has several sub-projects
that have the same short name (project.name) but different long names
(project.path). This hasn't been a problem in gradle, but it's really
confusing IDEA which doesn't allow modules with the same short name.
Unfortunately, I don't have a lot of control over the project
structure to rename things.
As best I can tell, IDEA modules get there names from the name of the
.iml file that defines them. Or at least that's the common way to
infer the name. So I tried setting the outputFile property to use a
filename derived from the path rather than the name of the project.
subprojects {
ideaModule {
outputFile = file(project.projectDir.canonicalPath + "/" +
rootProject.name + project.path.replaceAll(':', '.') + ".iml")
}
}
This solved part of the problem in that the resulting modules no
longer had names that collided. However, uncovered a new problem:
the module dependencies were still using the short names of the gradle
modules. Whatever generates IDEA module dependencies is not sensitive
to changes to the outputFile property even though some changes may
result in module name changes. So none of the cross-module
dependencies were resolving in IDEA.
For example, we have a gradle subproject :devel:platform:util that
ends up defining and IDEA module product.devel.platform.util.
However, any other IDEA modules that refer to it do so by the short
name util only. The gradle subproject :devel:ui:user generates one
such IDEA module in product.devel.ui.user.iml:
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
.
.
.
<orderEntry type="module" module-name="util" exported="" />
.
.
.
</component>
</module>
Anyone know of a solution?
I tried looking for a way to specify the IDEA module name hoping that
the code that generates defaults for both outputFile and the module
dependencies would delegate to that. But I couldn't find anything.
Cheers!
Jared
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email