views:

10

answers:

1

I work on several different projects which use feature branches; that is to say, each feature is implemented on an independent branch. I frequently need to switch between branches rapidly, or test different branches against each other (to see if a branch introduces test failures, or to use a client program in one branch against a server program in a different branch).

Practically speaking, in Eclipse, this means that I need to have a project in my workspace for each different branch.

I already have a little external Python script that creates the .project and .pydevproject files, but I still have to click on "File", "Import", "Existing Projects Into Workspace", "Browse", then select the file, then "Finish". Finally I have to wait for Eclipse to re-scan all of the "new" source code, even though it's the same as every other copy of this project that I have in my workspace.

I would like to automate any of these steps that I can. Is there a way to connect to Eclipse from a script and tell it to invoke this functionality?

A: 

If I understand correctly, IMHO your best option is to keep separate workspaces with the different branches and to skip between them. There are tools that can assist in syncing preferences between the workspaces.

Scripting in Eclipse is still a challenge. There are some plugins that provide some basic functionality, but nothing official or commonly used.

Another option is to control Eclipse form a Script in the operating system level. It depends on which platform you use.

If you are really into getting your hands dirty, those actions can be performed by a plugin. You can write one yourself, but there's some major coding effort involved here.

zvikico