Renaming package with the same package name across 4 repositories

Viewed 64

I have 4 repositories that have the same package names in them such as:

com.companyname.ateam.uiautomation

Each is in 4 repositories (Utils, WebDriver, Page, Test).
I want to rename the packages to actually be useful for each repository.
Then my next step is to merge at least 'page' and 'tests' into the same repositories.

In IntelliJ I have tried refactor.rename and refactor.move. It seems that since they all import from each other that the IDE just goes in and renames everything it finds with the package name and breaks the imports/references.

I spent a little time in Eclipse trying as well and it breaks the same things.
I a have also tried rename and move for asingle directory inside the package with the same results.

Has anyone dealt with this have a solution or tips? Many google searches haven't turned up this situation.

2 Answers

For those in the future. I didn't find a clean/intelligent way of doing this. I had to go the manual route. For each repo I had to:

  • Add new package
  • Drag assets into new package
  • Build package and manually and find an replace reference issues.

The refactor rename caused many more issues and I couldn't find a cleaner way of doing this. It was time intensive. Thank you for all that read.

Has anyone dealt with this have a solution or tips? Many google searches haven't turned up this situation.

Use the git filter-branch command

git filter-branch

git filter-branch --tree-filter 'sed <do what you want to do in here on your files>'
Related