views:

131

answers:

2

An Android Java project placed in a git repository and built in an Android tree in /packages/apps needs to have the project files located at the root of the git repository.

This is problematic for creating a complementary Test project, which should ideally be included in the same git repository so commits are atomic for both code and tests. Eclipse gets very unhappy if you include the Test project as a subdirectory.

Is there an appropriate approach for dealing with this other than creating a second repository?

A: 

I dont know git but this seems to be a code organization problem rather than git issue. I think I would create a workspace and then have the application and test project as sub projects within that workspace, like this

/packages/apps/<product-name> - This is the workspace

/packages/apps/<product-name>/app-name - This is the application

/packages/apps/<product-name>/app-name-test - This is the test project for the application

omermuhammed
Thanks for the reply! The Android build system does actually walk down more than one level of subdirectories in `/packages/apps`, but it doesn't actually build them correctly: it seems to construct some pathnames incorrectly and bails out.
orospakr
A: 

I don't use git inside eclipse. I have my repo cloned at ~/work/repo and have 2 subfolders one for the actual project and one for the test project. Then inside my workspace i have 2 symlinks that point to the folders inside the repo folder. Eclipse thinks they are both normal projects and doesn't care about the repo management. I just go to command line and "cd ~/work/repo; git add .; git commit; " and i can commit both test and code at the same time.

Hope that helps

Stoyan