2

I'm in an annoying situation with Eclipse and I want to know if there's a better way I can setup my project / git repository to avoid having to constantly manually fix my project to compile.

Background:

While developing our Android App we had a version 1.1.x live and in git.

We're now working on version 1.2.x in development, which is a fork of 1.1.x. At the same time, we have to switch back to the 1.1.x line to fix bugs in what's currently live.

The issue is that the 1.2.x line has a new Library Project in it, which is only present in the 1.2.x branch. I have to switch between both branches a lot to do development for both, but Eclipse isn't handling it very well.

When switching to the 1.1.x branch:

Problem: Eclipse complains e.g. "AndroidManifest.xml file missing!", because the folder for the library project no longer exists on the file system (git has deleted it - remember it's not in the 1.1.x branch).

Current Fix: Click on the folder in Package Explorer, delete it.

When switching to the 1.2.x branch:

Problem: I deleted the folder for the 1.1.x branch, so now that dependency is missing when Eclipse goes to build the project, and there's a bunch of build errors. To be clear, project.properties lists the dependency and it's in the Build Path - but (I don't know the terminology) the Eclipse whatever is missing from the workspace, and the dependency is listed as missing (shows as a red X under Project Properties > Android > Library).

Current Fix: Because of two different Eclipse bugs (Eclipse "Invalid Project Description" when creating new project from existing source, Some projects cannot be imported because they already exist in the workspace error in Eclipse), I have to Import > General > Existing ..., Browse... for the root directory, uncheck Copy, click refresh, and finally select the project and click Finish.

What can I do so that this process is automated when jumping across branches?

Community
  • 1
  • 1
jdowdell
  • 1,578
  • 12
  • 24

1 Answers1

0

If everybody is working in Eclipse then I you can commit your eclipse resources with your project

  • .project
  • .classpath
  • .settings/*

You might be ignoring these files in your .gitgignore, so simply remove them. This will not help for past commits unless you are willing to do a rebase with edit or filter-branch to add these files retroactively.

Joseph K. Strauss
  • 4,683
  • 1
  • 23
  • 40