I had a common 'PhoneGap' folder and VS solution, and then in subdirectories 'iOS' and 'Android', a separate codebase for each platform, with all the relevant Xcode and Eclipse workspaces. That was any device-specific tweaks, or testing through emulators, could be done easily.
So far, straightforward.
I think I decided against symbolic links because of issues on OS X? Can't quite remember.
I was using TFS at the time, so I then wrote a console Application that would, on run, replicate your pending changes in TFS into whichever subdirectories you configured. This would mean all 3 codebases would update together. I decided not to automate this step, and let the user control if their changes are replicated by running the console app. The app was able to add, edit or delete existing files where required, and I also had a 'blacklist' of files to ignore, which included cordova.js
.
It didn't take too long to knock up at all, the MSDN documentation is reasonable:
http://msdn.microsoft.com/en-us/library/bb138973.aspx
http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.workspace.pendadd.aspx
Here is a snippet:
var teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://dev:8080/tfs/MyCollection"));
versionControlServer = teamProjectCollection.GetService(typeof(VersionControlServer)) as VersionControlServer;
var pendingSets = versionControlServer.QueryPendingSets(new string[] { "$/" }, RecursionType.Full, workspaceInfo.Name, workspaceInfo.OwnerName);
if (pendingSets.Length > 0)
{
var allPendingChanges = pendingSets[0].PendingChanges;
}
...
These are the namespaces:
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;