Last night I began by spending a little time trying to figure out gestures on Android, and got wildly distracted by the notion of workspaces in Eclipse. My development thus far has been mainly in OS X. I thought it might be quick to just pull from mercurial and start back up on my desktop (win7) for a while. Oops.
The notion of a Visual Studio solution is analogous to the Eclipse workspace. Well, kind of. The problem seems to be that a workspace doesn’t just contain information about a collection of projects, but additional metadata about the _environment _itself. For instance, it also contains pointers to the SDK in use (for Android) and I assume similar information for other project types.
I suppose this is a pretty flexible model for dealing with many projects with varying targets and dependencies. The more I think about it the more sense it makes if you’re looking at it from the vantage point of an open source developer that may be dealing with 5 different versions of 12 different projects. In my case all I really want to do is share my source between my two machines. My natural inclinations (coming from a Visual Studio background) failed me completely.
To compound that, the plethora of ways to create new projects and their various side effects, such as whether the project is copied or linked, is kind of mind boggling. Again, I’m in unfamiliar territory. And I’m a developer… so no, I didn’t RTFM.
I did seem to find a solution that gets me to where I want to go though. I created a directory similar to this:
where android is the root directory of my mercurial repository and contains everything related to the particular project. The actual projects reside in srcprojectname and can be shared across workspaces. the win and osx directories actually contain my workspaces for the respective operating system. It’s not ideal, but it keeps the workspaces from my Eclipse instance in osx and win7 from stomping on each other, and everything seems to be working well so far.
To actually get the projects into the workspace, I’m using the File -> Import menu. From the import dialog I select “Existing Projects into Workspace” under the “General” node, and select the project directory in the next step of the import wizard. Leave “copy projects into workspace” unchecked so the source stays where it is.