Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » preprocess .launch files
preprocess .launch files [message #521607] Thu, 18 March 2010 05:58 Go to next message
Eclipse UserFriend
When having different project names the same launch file cannot be used. In some attributes a ${} variable can be used, but not everywhere.

Currently the StringAttribute org.eclipse.jdt.launching.PROJECT_ATTR must be manually set to the current projects name. Is there a way to get around this available?

I have tried using the extension point org.eclipse.debug.core.launchDelegates to manipulate (replace a placeholder for the project name etc) the launch file before starting. And yes it works if i change the working copy and save it do disk. But the thing is that i don't want to write those changes to disk since the launch files are under source control.

Is there a way to manipulate a .launch file before executing the actual "Run As/Debug As" ?


For example the launch definition below contains 2 placeholders that i want to update with the project name before running it.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/PLACEHOLDER/src/foo/Bar.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="foo.Bar"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="PLACEHOLDER"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=""/>
</launchConfiguration>

Re: preprocess .launch files [message #522431 is a reply to message #521607] Mon, 22 March 2010 11:47 Go to previous message
Eclipse UserFriend
I tried using the extension point: org.eclipse.core.variables.dynamicVariables to define a new variable to be introduced in the launch file. But it seems like the variable does not get resolved. So no luck there either.
Not really sure if that is the way it works or if some variables are hardcoded to work with launch files?
Previous Topic:How to add "Class-Path: ." to MANIFEST.MF when generating jar from Eclipse?
Next Topic:Eclipse 3.0
Goto Forum:
  


Current Time: Fri Mar 21 23:49:37 EDT 2025

Powered by FUDForum. Page generated in 0.03563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top