How to create a generic launch configuration with Eclipse?

Tags: , , , ,



I have a run configuration in my eclipse. In my project we have two branches : DEV and STABLE.
I would like to create one run configuration for building my project whatever branch it is on.

For now, when I set Base directory with one of those two variables : ${project_path}, ${build_project}, I face this error :

Base directory doesn’t exist or can’t be read.

This works : ${workspace_loc:/my-project-dev-branch} but is tied to a particular branch. I must duplicate this configuration for building the stable branch.

  • So, how can I view the actual content of ${project_path}, ${build_project} ?
  • Or which variable should I use to get this result : ${workspace_loc:/${eclipse_variable_with_project_name}} ?

Answer

I’m not sure I follow how your branches are represented within the workspace, but

  • ${project_path} represents a path relative to your workspace
  • ${build_project} will only be set during an actual build (not during an execution of your program)

Based on your description you want to be using ${project_loc} instead.

Nota: The project MUST be selected in the perspective project before launching the run configuration. Otherwise, you will get a message like in the screenshot below :

picture of Alert box popup with the text 'Launching MY RUN CONFIGURATION' has encountered a problem.  Variable references empty selection: ${project_loc}'



Source: stackoverflow