Gradle subprojects with the same name do not work for eclipse

I have the following structure

root
|- foo    
|  |- implementation
|  |   \- build.gradle
|  \- interface
|      \- build.gradle
|
|- bar
|  |- implementation
|  |   \- build.gradle
|  \- interface
|      \- build.gradle
|
|- build.gradle
\- settings.gradle

in settings.gradle I have the following:

include ':foo:implementation', ':foo:interface'
include ':bar:implementation', ':bar:interface'

in my build.gradle in the root folder I placed all of them as a dependency

dependencies { 
    compile project(':foo:implementation')
    compile project(':foo:interface')
    compile project(':bar:implementation')
    compile project(':bar:interface')
}

Eclipse requires each project to have different names. Gradle uses the project name by default to name them in eclipse. Thus, eclipse cannot distinguish between ": foo: implementation" and ": bar: implementation:" since they will both be called "implementation" inside Eclipse. In my opinion, this should have been resolvable by setting the name of the eclipse project to something more specific, for example:

allprojects {
    eclipse.project {
        if (project == rootProject) {
            name = rootProject.name
        } else {
            name = rootProject.name + project.path.replace(":", "-")
        }
    }
}

With this, I get unique project names, but when I look at the .classpath xml, there is only one of the implementation projects and one of the interface projects.

Any idea?

+5
2

" "; :

  • eclipse "w140 > ", " ". , ( )
  • , , : gradle ?. , . gradle BTW
  • , eclipse , , ...
+1

, Gradle; . GitHub.

0

All Articles