<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bingshui.org &#187; linked libraries</title>
	<atom:link href="http://www.bingshui.org/tag/linked-libraries/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bingshui.org</link>
	<description>the Life of Zim</description>
	<lastBuildDate>Thu, 02 Feb 2012 16:27:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eclipse: Resources, Resolved Locations, and the .PREFS file that links them</title>
		<link>http://www.bingshui.org/tech/eclipse-resources-resolved-locations-and-the-prefs-file-that-links-them-2/</link>
		<comments>http://www.bingshui.org/tech/eclipse-resources-resolved-locations-and-the-prefs-file-that-links-them-2/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 20:45:00 +0000</pubDate>
		<dc:creator>dzimney</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[linked libraries]]></category>
		<category><![CDATA[linked resources]]></category>
		<category><![CDATA[locationURI]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[resolved location]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://wordpress.bingshue.com/?p=56</guid>
		<description><![CDATA[I&#8217;ve finally found the Eclipse prefs file that stores the local file path to linked resources (linked libraries). Linked resources are basically shortcuts to files/folders on your local system. Buried in the Workspace/.metadata/.plugins/loc.eclipse.core.runtime/.settings/ folder (on OS X), the loc.eclipse.core.resources.prefs file contains the absolute paths to those linked libraries. A few months ago I began working [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally found the Eclipse prefs file that stores the local file path to linked resources (linked libraries). Linked resources are basically shortcuts to files/folders on your local system. Buried in the <em><span style="color:#940f04;">Workspace/.metadata/.plugins/loc.eclipse.core.runtime/.settings/</span></em> folder (on OS X), the <em><span style="color:#940f04;">loc.eclipse.core.resources.prefs</span></em> file contains the absolute paths to those linked libraries.</p>
<p><a href="http://3.bp.blogspot.com/_L7Xyjw2P_XI/SRySwErgDjI/AAAAAAAAHlw/mBw0az6Reww/s1600-h/eclipse_ide.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5268247018704211506" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 150px; height: 99px;" src="http://3.bp.blogspot.com/_L7Xyjw2P_XI/SRySwErgDjI/AAAAAAAAHlw/mBw0az6Reww/s320/eclipse_ide.jpg" border="0" alt="" /></a>A few months ago I began working with Ant tasks in Eclipse. Specifically, I was using <a href="http://www.google.com/url?sa=U&amp;start=1&amp;q=http://code.google.com/p/fdtkit/&amp;ei=WZMcSe-KGJzENI_zrdUJ&amp;sig2=X8NlezKVlj5LDrB9nXKvQw&amp;usg=AFQjCNHPTM92c6YIUYeK--esf76oAG7iXg">fdtkit</a> along with Ant in Eclipse to generate JavaDocs for my Actionscirpt 2.0 libraries using <a href="http://www.google.com/url?sa=U&amp;start=1&amp;q=http://www.badgers-in-foil.co.uk/projects/as2api/&amp;ei=mJMcSeiWH4jKNIvGjM8J&amp;sig2=OpvGNM2cUGVqv9MlF-xbTw&amp;usg=AFQjCNHVvgXIwqa5OXEEQf2OdDq4eKgNjg">as2api</a>. For the most part fdtkit is a fabulous tool, or rather toolbox for generating JavaDocs and numerous other tasks with the use of Ant. However, the issue that I very soon found myself confronted with was documenting classes from linked libraries in Eclipse. Normally I will set up a project with a <em>src</em> containing code specific to that project, and then make use of linked libraries to make use of code from other projects/api&#8217;s. When running an Ant task to create my JavaDocs I was unable to intelligently identify the paths to my linked libraries to add to the documentation.</p>
<p>The way Eclipse and FDT handle linked libraries is through the IDE and the <em>.project</em> file found in the root of the project folder. Opening the <em>.project</em> file, you might see something like this (assuming you are using linked libraries):</p>
<blockquote><p><span class="Apple-style-span" style="font-family:'courier new'; font-size:11px;">&lt;link&gt;<br />
&lt;name&gt;core&lt;/name&gt;<br />
&lt;type&gt;core&lt;/type&gt;<br />
&lt;locationURI&gt;FP8&lt;/locationURI&gt;<br />
&lt;/link&gt;</span></p></blockquote>
<p>Looking at the link object, you will see two important pieces of information the <em>name</em> property and the <em>locationURI</em> property. Now the <em>name</em> property represents the name associated with the linked library (obviously) and then there&#8217;s the <em>locationURI</em>. The <em>locationURI</em> is a reference to the linked resource. The problem here is where the hell is the identity of that <em>locationURI</em>? In the Eclipse IDE you can select a linked library in the Explorer view and then examine it with the properties view. Here you will see the value for the <em>resolved location</em>, which is the full, absolute path to the linked library on your local system. But how the hell to I get that property with Ant? How to I access it all? Well, I&#8217;ve been asking that question for quite some time, scouring the Internet and finding nothing. Today, I found my answer.</p>
<p>Determined to know how linked resources were being saved on my system I began digging deep in the my Eclipse folder to find property in some buried file. Note, I&#8217;m running Eclipse 3.3 on OS X. I would imagine the path is similar on Windows, but probably not exactly the same (I&#8217;m guessing it&#8217;s pretty damn close to the same in Linux). Anyway&#8230;</p>
<p>The file location is: <em>${your_eclipse_workspace_folder}/.metadata/.plugins/loc.eclipse.core.runtime/.settings/loc.eclipse.core.resources.prefs</em><br />
This file looks something like:</p>
<blockquote><p><span class="Apple-style-span" style="font-family:'courier new'; font-size:11px;">pathvariable.FP7 = /Users/local/Workspace/fdtkit/lib/FP7<br />
pathvariable.FP8 = /Users/local/Workspace/fdtkit/lib/FP8<br />
pathvariable.FP9 = /Users/local/Workspace/fdtkit/lib/FP9</span></p></blockquote>
<p>So now, through Ant task it is possible to have your build.xml (relative to your project) parse the <em>.project</em> file of the project for linked libraries and with the <em>locationURI</em> parameters to grab the absolute path to the class library from the <em>loc.eclipse.core.resources.prefs</em> file.</p>
<p>Please feel free to contact me if you have any questions regarding this post. I&#8217;m sure this isn&#8217;t the most straight forward explanation of what I&#8217;ve found here, but I&#8217;m a little to jacked up on coffee to form clear coherent thoughts right now.</p>
<p>Note: Linked resources are <em>Workspace</em> specific. Different workspaces have a different set of linked resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bingshui.org/tech/eclipse-resources-resolved-locations-and-the-prefs-file-that-links-them-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

