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 on the root folder I put all of them as a dependency
dependencies {
compile project(':foo:implementation')
compile project(':foo:interface')
compile project(':bar:implementation')
compile project(':bar:interface')
}
Eclipse needs each project to have distinct names. Gradle by default uses the project name to name these in eclipse. Thus eclipse is unable to distinguish between ':foo:implementation' and ':bar:implementation:' as they both will be named 'implementation' inside Eclipse. In my mind this should have been solvable by setting the eclipse project name to something more specific, e.g.:
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 only one of the implementation projects and one of the interface projects are present.
Any idea?
So far, I've only been working with "single dir level" multiprojects; For that scenario, there are several ways to fix it:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With