Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Can I pass parameters to Buckminster?
Can I pass parameters to Buckminster? [message #383221] Fri, 13 March 2009 14:58 Go to next message
John is currently offline JohnFriend
Messages: 107
Registered: July 2009
Senior Member
Hi!


There are places in my Buckminster files where I would like to use
flexible parameters.
In all my files I use relative paths to reference my other Buckminster
files like cquery, rmap, properties. This works but requires that I can
control my working directory. So to free the build from this restriction
it would be nice if I could reference the paths to these files using a
parameter.

When resolving from a workspace on disk I need to specify the directory in
my rmap and when resolving from CVS I need the pserver URI.

I most of the above places I can of course specify this in a property, but
I would actually rather like to pass the values in another way. One way
could be using environment variables, but I haven't been able to find any
documentation that tells me how to reference the value of this in the
different files.

Other examples are the location where the build materializes into,
Buckminster temp files and the buckminster.output.root. Some of them are
set in my bat files, so they are fine.
Currently I set buckminster.output.root in a properties file. Can I
parameterize it here?
org.eclipse.buckminster.pde.targetPlatformPath is set using setpref in my
build script. Can I parameterize it here?

Could somebody please help me in solving this? Can it be done and should I
in this case specify the values elsewhere?

Thanks.

/John.
Re: Can I pass parameters to Buckminster? [message #383222 is a reply to message #383221] Fri, 13 March 2009 15:51 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi John,
The system properties are passed on so you can always try passing
-vmargs -Dkey=value to Buckminster. The perform command will also accept
-Dkey=value or -P <properties file> directly.

Regards,
Thomas Hallgren


John wrote:
> Hi!
>
>
> There are places in my Buckminster files where I would like to use
> flexible parameters.
> In all my files I use relative paths to reference my other Buckminster
> files like cquery, rmap, properties. This works but requires that I can
> control my working directory. So to free the build from this restriction
> it would be nice if I could reference the paths to these files using a
> parameter.
>
> When resolving from a workspace on disk I need to specify the directory
> in my rmap and when resolving from CVS I need the pserver URI.
>
> I most of the above places I can of course specify this in a property,
> but I would actually rather like to pass the values in another way. One
> way could be using environment variables, but I haven't been able to
> find any documentation that tells me how to reference the value of this
> in the different files.
>
> Other examples are the location where the build materializes into,
> Buckminster temp files and the buckminster.output.root. Some of them are
> set in my bat files, so they are fine.
> Currently I set buckminster.output.root in a properties file. Can I
> parameterize it here?
> org.eclipse.buckminster.pde.targetPlatformPath is set using setpref in
> my build script. Can I parameterize it here?
>
> Could somebody please help me in solving this? Can it be done and should
> I in this case specify the values elsewhere?
>
> Thanks.
>
> /John.
>
Re: Can I pass parameters to Buckminster? [message #383223 is a reply to message #383222] Fri, 13 March 2009 16:43 Go to previous messageGo to next message
John is currently offline JohnFriend
Messages: 107
Registered: July 2009
Senior Member
Hi Thomas!

Thanks for the response.

Yes, the two properties buckminster.output.root and
org.eclipse.buckminster.pde.targetPlatformPath can be set as -vmargs and
this will solve those two.

But what about my scriptfile? It looks like:

import buildpsd.cquery
perform --properties buildpsd.properties
my.company.cd.psd.delivery#create.my.company.cd.core.applica tion.product

It relies on correct relative path to the two files buildpsd.cquery and
buildpsd.properties. How can I parameterize a fixed path to these?
Besides, of course, by calling Buckminster twice with each command from my
bat file and thereby start the headless Eclipse twice.

I still also rely on relative path in my cquery to the rmap file.
And how do I parameterize the resolve paths used in my rmaps?

Are you saying that I can invent my own system properties and reference
them in the cquery and rmap files? Could I do something like -vmargs
-D"my.resolve.path=c:\source" and then reference it like
${my.resolve.path} in my rmap file?

Thanks.

/John
Re: Can I pass parameters to Buckminster? [message #383225 is a reply to message #383223] Fri, 13 March 2009 17:32 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
John wrote:
> Hi Thomas!
>
> Thanks for the response.
>
> Yes, the two properties buckminster.output.root and
> org.eclipse.buckminster.pde.targetPlatformPath can be set as -vmargs and
> this will solve those two.
>
> But what about my scriptfile? It looks like:
>
> import buildpsd.cquery
> perform --properties buildpsd.properties
> my.company.cd.psd.delivery#create.my.company.cd.core.applica tion.product
>
> It relies on correct relative path to the two files buildpsd.cquery and
> buildpsd.properties. How can I parameterize a fixed path to these?
> Besides, of course, by calling Buckminster twice with each command from
> my bat file and thereby start the headless Eclipse twice.
>
Try using
import ${path.to.query}/buildpsd.cquery

Run using -vmargs -Dpath.to.query=/your/path/to/query

> I still also rely on relative path in my cquery to the rmap file.
>
The CQUERY will always resolve the RMAP path relative to itself in case
the RMAP path is relative so I don't think that's an issue.

> And how do I parameterize the resolve paths used in my rmaps?
>
> Are you saying that I can invent my own system properties and reference
> them in the cquery and rmap files? Could I do something like -vmargs
> -D"my.resolve.path=c:\source" and then reference it like
> ${my.resolve.path} in my rmap file?
>
Yes, that's what I'm saying. Please note though that in the provider uri
you need to use a construct involving "{0}" in combination with a
<propertyRef key="my.resolve.path"> element.

Regards,
Thomas Hallgren
Re: Can I pass parameters to Buckminster? [message #383512 is a reply to message #383225] Thu, 19 March 2009 21:23 Go to previous messageGo to next message
John is currently offline JohnFriend
Messages: 107
Registered: July 2009
Senior Member
Hi Thomas!


I have now parameterized my build script. It generally works except for
one place.
I call Buckminster with the system property
-D" my.company.cd.build.product.plugin.id=my.company.cd.psd.deli very ".
Im my cquery I have <cq:rootRequest
name="my.company.cd.build.product.plugin.id" componentType="osgi.bundle"/>.

I then get the error:

ERROR [0001] : Unable to find a searchPath for component
${my.company.cd.build.product.plugin.id}

According to the documentation "References to a property are typically
made using the common syntax ${PROPERTYKEY}. References to properties can
be given anywhere except within regular expressions.".

So the name isn't a regular expression, right? Shouldn't this work or what
am I doing wrong?

Thanks.

/John
Re: Can I pass parameters to Buckminster? [message #383513 is a reply to message #383512] Thu, 19 March 2009 21:33 Go to previous messageGo to next message
John is currently offline JohnFriend
Messages: 107
Registered: July 2009
Senior Member
Hi again!


After having hard coded the previous value I now get a new error:
WARN: java.lang.IllegalArgumentException: can't parse argument number
my.company.cd.build.disk.source.dir.

This is caused by the following URI in my rmap for a url.catalog
readerType:
<uri format="file:${my.company.cd.build.disk.source.dir}/{0}">

Shouldn't this also be OK?

This and the one mentioned in the previous post are the only two places
where it doesn't work.

Thanks.

/John
Re: Can I pass parameters to Buckminster? [message #383514 is a reply to message #383513] Thu, 19 March 2009 21:56 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
John wrote:
> Hi again!
>
>
> After having hard coded the previous value I now get a new error:
> WARN: java.lang.IllegalArgumentException: can't parse argument number
> my.company.cd.build.disk.source.dir.
>
> This is caused by the following URI in my rmap for a url.catalog
> readerType:
> <uri format="file:${my.company.cd.build.disk.source.dir}/{0}">
>
> Shouldn't this also be OK?
>
No, this is not OK. The uri is a format string. Change the above to

<uri format="file:{0}/{1}">
<propertyref key="my.company.cd.build.disk.source.dir"/>
...

- thomas
Re: Can I pass parameters to Buckminster? [message #383515 is a reply to message #383512] Thu, 19 March 2009 21:58 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi John,
It might well be that the root request is not subject to property
expansion. If you need that, then please add a bugzilla for it.

- thomas

John wrote:
> Hi Thomas!
>
>
> I have now parameterized my build script. It generally works except for
> one place.
> I call Buckminster with the system property
> -D" my.company.cd.build.product.plugin.id=my.company.cd.psd.deli very ".
> Im my cquery I have <cq:rootRequest
> name="my.company.cd.build.product.plugin.id" componentType="osgi.bundle"/>.
>
> I then get the error:
>
> ERROR [0001] : Unable to find a searchPath for component
> ${my.company.cd.build.product.plugin.id}
>
> According to the documentation "References to a property are typically
> made using the common syntax ${PROPERTYKEY}. References to properties
> can be given anywhere except within regular expressions.".
>
> So the name isn't a regular expression, right? Shouldn't this work or
> what am I doing wrong?
>
> Thanks.
>
> /John
>
Re: Can I pass parameters to Buckminster? [message #383524 is a reply to message #383515] Sun, 22 March 2009 20:48 Go to previous message
John is currently offline JohnFriend
Messages: 107
Registered: July 2009
Senior Member
Hi Thomas!


The bugzilla id is 269630.


/John
Previous Topic:buckminster.bat only passes max 9 vmargs
Next Topic:Product config.ini generation
Goto Forum:
  


Current Time: Sun Sep 22 11:14:49 GMT 2024

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

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

Back to the top