Bug 385855 - [target] Target platform definition must be able to specify environment variables
Summary: [target] Target platform definition must be able to specify environment varia...
Status: NEW
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 403328
  Show dependency tree
 
Reported: 2012-07-24 09:44 EDT by Andrey Loskutov CLA
Modified: 2013-03-21 06:00 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2012-07-24 09:44:38 EDT
AS IS:
Target platform definition allows us to set available plugins, vm arguments etc. Out of this information, a new instance of Java/Junit launch configuration inherit some settings. 

Our application relies on jni/native code and different native libraries. Se we can specify LD_LIBRARY_PATH and other environment variables for the Java/JUnit launch configurations but we can NOT specify LD_LIBRARY_PATH etc for the target platform. So every developer creating new launch configuration must manually set LD_LIBRARY_PATH and few other variables to the right values, which is both error prone and highly unreliable.

TO BE:
It would be great if:

1) the target platform definition file could include environment variables section
2) those environment variables would be automatically re-used by newly created java/JUnit launch configurations (mapAttribute key="org.eclipse.debug.core.environmentVariables")
3) (optional) a nice UI for the target editor allowing me edit environment variables
Comment 1 Curtis Windatt CLA 2012-07-24 11:56:46 EDT
I see how this would be useful for your application.  There isn't committer time available for working on it so I have marked this as help wanted.

If this was implemented it should definitely have a UI in the target editor and wizard similar to the environment tab.  This could mean copying a lot of the UI code from debug.  Alternatively, moving the debug UI into an 'environment block' that could be made API (or x-friended) would allow PDE to reuse it.  The API might be useful for other applications as well.
Comment 2 Michael Rennie CLA 2012-07-30 09:42:05 EDT
(In reply to comment #1)
> If this was implemented it should definitely have a UI in the target editor
> and wizard similar to the environment tab.  This could mean copying a lot of
> the UI code from debug.  Alternatively, moving the debug UI into an
> 'environment block' that could be made API (or x-friended) would allow PDE
> to reuse it.  The API might be useful for other applications as well.

If someone were to work on this, and were to look at making API from the components on the EnvironmentTab, the relevant classes / methods would be:

org.eclipse.debug.ui.EnvironmentTab
org.eclipse.debug.core.ILaunchManager#getNativeEnvironment()
org.eclipse.debug.core.ILaunchManager.getNativeEnvironmentCasePreserved()