Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster dev » Re: [buckminster-dev] Relative URI for local readerType in provider search path
Re: [buckminster-dev] Relative URI for local readerType in provider search path [message #533314] Thu, 13 May 2010 09:02
Oisin Hurley is currently offline Oisin HurleyFriend
Messages: 204
Registered: July 2009
Senior Member
What I generally do in a buckminster build is have a dual-resolution
approach in the rmap by putting two providers in the searchPath
element. Here's an example from ld/trunk/stp/

The 'local' provider does the resolution for the disk - you'll see that the
URI format uses a ${project.root} buckminster property expansion to
indicate the base directory where the code to be discovered resides.

<searchPath name="sca.features">
<provider readerType="local"
componentTypes="eclipse.feature,osgi.bundle" mutable="true"
<uri format="{0}/{1}">
<bc:propertyRef key="project.root" /> <!-- THIS IS IT -->
<bc:propertyRef key="buckminster.component" />
<provider readerType="svn"
mutable="true" source="true">
<uri format=" /{0}">
<bc:propertyRef key="buckminster.component" />

-----end example-----

So, the next question might be - how do I get that value 'into' the build?
When starting up buckminster you need to give the launching JVM values for
any properties that are addressed from within the buckminster artifacts. In the
STP build [0] I use Apache Ant to kick things off. I make an Ant macro which
declares a <buckminster> Ant task [1] that I use later on (effectively this is
copied from Buckminster's own build :) There are a couple of magic moments
that are to be explained at this point.

1. You want to provide ${project.root} as a path, e.g. "../..". Buckminster
doesn't like that - it wants a URL. So the magic <makeurl> task does
this transform.

<makeurl file="${project.root}" property="project.root.url" validate="false"/>

The URL to feed to Buckminster is now in ${project.root.url}. I don't validate
the URL because that would spew if the file did not exist. Remember I want
to check for local disk presence and if not found fallback to checking it out
from source. So 'not found' is a valid result for me in my use-case.

2. The value of the property is passed as a JVM argument to invoking

<java fork="true" jar="${buckminster.launcher.jar}" failonerror="true">
<jvmarg value="-Dproject.root=${project.root.url}"/>

Note the name change here - ${project.root} is what the rmap seeks.

Another thing worth noting if you haven't spotted this already is that your
cquery will natively take a relative path for locating your rmap like so:

<componentQuery xmlns=""

Feel free to go in and help yourself to chunks of build from the STP
project - a simple example would be [2] - just svn co <that URL> -
it will pull in some svn externals - and you can explore a bit.


[0] ld/trunk
[1] ld/trunk/buckminster/buckminster.xml
[2] itor/org.eclipse.stp.policy/trunk/build
Previous Topic:[buckminster-dev] Relative URI for local readerType in provider search path
Next Topic:Running Buckminster via java -jar fails to import with JDK 1.5
Goto Forum:

Current Time: Wed Sep 22 21:57:55 GMT 2021

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

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

Back to the top