[Eclipse] Exporting & Importing Launch configurations - Digizol6

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Thursday, November 7, 2013

[Eclipse] Exporting & Importing Launch configurations

Many Eclipse "Launch Configuration" created has so much details; OSGi configurations for instance. So there arises a requirement of exporting the launch configurations and later importing them into other Eclipse workspaces. Interestingly, Eclipse has an import/export feature for "Launch Configuration"; which is quite simple but handy. I believe some software developers are not taking the advantage of this.

Here are the steps to follow.

1. Exporting Configurations

First you need to select:
  File -> Export...
Then select:
  Run/Debug -> Launch Configurations

Then you will see a view with all available launch configurations as shown below. You can select the configurations you need to export. You need a provide a location to store the exported configurations.

Each configuration will be saved into separate XML files, but with the extension as ".launch".

2. Importing Configurations

Similar to export, first you need to select:
  File -> Import...
Then select:
  Run/Debug -> Launch Configurations

Then you will see a view where you can select a directory with ".launch" files. When that folder is selected, available launch configurations will be displayed in the UI; so that you can select which ones to be imported as shown below.

3. Sample .launch file

Below is the exporter file for the OSGi launch configuration we created for Eclipse Kepler 4.3.1.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
<booleanAttribute key="append.args" value="true"/>
<booleanAttribute key="automaticAdd" value="true"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Multi-Management-App"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="default_auto_start" value="true"/>
<intAttribute key="default_start_level" value="4"/>
<booleanAttribute key="includeOptional" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="true"/>
<stringAttribute key="target_bundles" value="org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.eclipse.equinox.console@default:default,org.eclipse.osgi@-1:true"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<stringAttribute key="workspace_bundles" value="com.digizol.osgi.multiservice.english@default:default,com.digizol.osgi.multiservice.sinhala@default:default,com.digizol.osgi.multiservice@default:default,com.digizol.osgi.baseservice@default:default"/>
</launchConfiguration>

Hope this helps you.

No comments:

Post a Comment

Post Top Ad

Responsive Ads Here