Issue while importing multiple projects with a repeated module name


(Eduardo Marques) #1

Hi guys,

I’m trying to import 2 multi module gradle projects into my workspace, but I’m facing an issue while doing it, because both projects have one folder with the same name.
The projects have the following folder structure:

  • Repository A

    • app
      • build.gradle
    • mocks
      -build.gradle
    • build.gradle
    • settings.gradle
  • Repository B

    • app
      • build.gradle
    • solr
      • build.gradle
    • build.gradle
    • settings.gradle

After I import Repository A, I can’t import Repository B as one of its modules has the same as in Repository A, getting the following error while trying to import B:

While importing I’ve tried to import them to different working sets, but also didn’t work…

Versions of:
Eclipse - Photon Release (4.8.0)
Buildship - 2.2.1.v20180125-1441

Any advice on how to achieve this?


(Donát Csikós) #2

This is a limitation in Buildship that it can’t handle clashing names from different builds. You can fix that by adjusting the eclipse project names with the following snippet:

apply plugin: 'eclipse'
 
subprojects {
    eclipse.project.name = (rootProject.name + project.path).replaceAll(':', '-')
}