This is what I did. If there is a better way please reply.
- Make sure all developers have installed Android SDK & Tools in the same paths.
- Install the Eclipse TFS plugin from Microsoft.
Link at the time of this writing is: http://www.microsoft.com/en-us/download/details.aspx?id=25125
Here are the steps I followed:
- I started my Android project in a random folder (workspace) and did my initial development.
- Then I wanted to move the project under my development branch at
$root/Development/MyBranch/Android
- The Android folder did not exist, so I created is using TFS. If you do it manually from explorer then TFS will not let you create it server-side.
- From the original project workspace I did "Export" --> "General|Preferences", to some folder.
- Then I did "Switch Workspace" --> "Other"
I specified the local path of
$root/Development/MyBranch/Android
- Now I get an empty workspace.
- Then I did "Import" --> "Project Settings" and specified the file I exported before.
- Then I did "Import" --> "General|Existing Projects into Workspace" with "Copy Projects into Workspace".
- Amazingly enough I got my project up and running from the new location, with a few hiccups as usual.
- Then I did "Team|Share Project..."
- I followed the wizard.
- There is a crazy screen about creating a new workspace. Just click EDIT and make sure that the TFS root mapping is ok.
- Finish the wizard and you are done so far.
- When you run the project, the plugin will also add the gen and bin folders to TFS. Don't try to battle this, just check them in. More details later.
- At this point, I have everything checked-in, so I merge to Main.
- At this step I want to merge the project to another developer's branch.
- The process is similar.
- Using TFS create the $root/Development/OtherDev/Android folder.
- Start Eclipse on the dev's PC and do "Switch Workspace" --> "Other"
- Specify the local path of $root/Development/OtherDev/Android
- Now you get an empty workspace.
- Then "Import" --> "Project Settings" and specify the preferences file exported before (I included it in TFS for reference).
- Then "Import" --> "General|Existing Projects into Workspace" with "Copy Projects into Workspace" and copy the project from the local folder of $root/Main/Android
- Then do a "Team|Share Project..." to connect the project with TFS.
- Now close Eclipse.
- Do a merge
$root/Main/Android
to$root/Development/OtherDev/And
- Checkin
$root/Development/OtherDev/Android
Guess what, looks like you are done. Unless I did something wrong, but it "works on our PCs", so far.
Special note: Since Eclipse/TFSPlugin will always try to add the gen+bin dirs to source control, simply keep them always checked out, and even if you check them in sometime, don't merge them back to main. It's just a waste of disk space on TFS merging these files around.
This method is so complicated, that it just doesn't feel right. Is there a better way to get the same results?
Thanks!
As for the bin/gen directories... TFS 2010 SP1 and newer has an ignore option. Bin should be added automatically but gen isn't. To add, Right click the folder, then choose Team and then Click Ignore. You will probably need to remove these folders in TFS aftwerwards, but they will not sync with TFS anymmore.