Bug 160948 - [build path] add UI for project relative native lib paths
Summary: [build path] add UI for project relative native lib paths
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-13 22:14 EDT by Sven Köhler CLA
Modified: 2022-10-07 12:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Köhler CLA 2006-10-13 22:14:23 EDT
Hi,

let me quote some text from a .classpath-file in a project created with Eclipse 3.2.1:

<classpathentry kind="lib" path="lib/jogl-1.0.0.jar" sourcepath="lib/jogl-1.0.0-src.zip">
	<attributes>
		<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SWT-Test/lib/natives/jogl-1.0.0"/>
	</attributes>
</classpathentry>


As you can see, "path" and "sourcepath" are relative to the project-root. The projectroot is /path/to/workspace/SWT-Test. But the value of the additional attribute CLASSPATH_ATTR_LIBRARY_PATH_ENTRY is stored relatively to the workspace-root.


My personal favourite of solving this inconsequence, is to store absolute paths only, but by using variables like ${project_loc}. Than all hassle of interpretating relative paths will be gone.
Comment 1 Sven Köhler CLA 2006-10-13 22:18:26 EDT
Addition:

I am complaining, because projects can be stored in different folders when shared with CVS between several people/computers. Maybe, the folder "SWT-Test" is called "SWT-Test2" on another computer. Who knows?


BTW: I changed by .classpath-file to use the variable ${project_loc}, and it seems to work! So this maybe just a UI problem. The UI should generate paths using variables like ${project_loc}, if possible.
Comment 2 Sven Köhler CLA 2006-10-14 00:26:03 EDT
(In reply to comment #1)
> BTW: I changed by .classpath-file to use the variable ${project_loc}, and it
> seems to work! So this maybe just a UI problem. The UI should generate paths
> using variables like ${project_loc}, if possible.

I was wrong. The variable ${project_loc} is sensible to the current selection within the package-explorer which is not what i intended.
Comment 3 Frederic Fusier CLA 2006-10-15 12:42:40 EDT
The CLASSPATH_ATTR_LIBRARY_PATH_ENTRY attribute is used and stored by JDT/UI...
Comment 4 Martin Aeschlimann CLA 2006-10-17 05:01:29 EDT
by JDT/debug...
Comment 5 Darin Wright CLA 2007-02-09 13:31:35 EST
Moving back to JUI. Although JDT launching defines the attribute, all instances of the attribute are created by JUI (see NativeLibAttributeConfiguration). We have an API for creating and decoding the attributes in JavaRuntime:

public static String[] getLibraryPaths(IClasspathAttribute attribute)
public static IClasspathAttribute newLibraryPathsAttribute(String[] paths)

However, when creating the paths, we do not have a project context in order to tell if the attribute should be made project relative, or workspace relative. JUI may have this information, since they have a project context for the build path page. JUI could use ${project_loc} in this case to resolve to the project in which the entry is being used. However, for references in other projects, a workspace relative path would need to be used. 
Comment 6 Eclipse Genie CLA 2020-06-16 18:55:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Eclipse Genie CLA 2022-10-07 12:11:46 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.