Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Can the component name in a CQUERY be overridden?(How to handle many similar CQUERYs)
Can the component name in a CQUERY be overridden? [message #647942] Mon, 10 January 2011 14:51 Go to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
We have a large number of projects that all have a similar dependency and build structure. To materialise one of these projects, developers use a kind of 'template' CQUERY for a buckminster component which I have called XX-config.

Within the Eclipse IDE, the developer simply opens the template CQUERY (which is located at a web url), changes the component name to, e.g. i24-config, and clicks "resolve and materialise".

Now, I want to do the same using headless buckminster. However, I can't find any wasy way to override the component name. I tried
    import -Dbuckminster.component=i24-config http://myserver/XX-config.cquery

but it didn't work (which is not that surprising).

Is there a way to dynamically determine the component name? I get the impression that Buckminster expects a separate CQUERYs for each root component, but is there a way to avoid having many CQUERYs that vary only in component name?

Obviously I could wget the template CQUERY and then edit it using a script, but this seems hacky and fighting Buckminster rather than working with it.

I'm really keen to get a good solution in place, as I see Buckminster as the solution to managing our dependency mess. I've managed to do quite a lot so far.

Thanks
Matthew
Re: Can the component name in a CQUERY be o verridden? [message #647976 is a reply to message #647942] Mon, 10 January 2011 15:46 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Not sure if there is support to set the queried component using a property
(I.e an arbitrary property interpolated into the queried name). Don't think
you can set buckminster.component directly, it is the resulting property
(what buckminster is looking for) as it changes over time.
Another idea is to use an advisor node as it may allow more flexible
control.
- henrik

Matthew Webber <Matthew.Webber@diamond.ac.uk> wrote:
> We have a large number of projects that all have a similar dependency and
> build structure. To materialise one of these projects, developers use a
> kind of 'template' CQUERY for a buckminster component which I have called XX-config.
>
> Within the Eclipse IDE, the developer simply opens the template CQUERY
> (which is located at a web url), changes the component name to, e.g.
> i24-config, and clicks "resolve and materialise".
>
> Now, I want to do the same using headless buckminster. However, I can't
> find any wasy way to override the component name. I tried
>
> import -Dbuckminster.component=i24-config http://myserver/XX-config.cquery
>
> but it didn't work (which is not that surprising).
> Is there a way to dynamically determine the component name? I get the
> impression that Buckminster expects a separate CQUERYs for each root
> component, but is there a way to avoid having many CQUERYs that vary only
> in component name?
>
> Obviously I could wget the template CQUERY and then edit it using a
> script, but this seems hacky and fighting Buckminster rather than working with it.
>
> I'm really keen to get a good solution in place, as I see Buckminster as
> the solution to managing our dependency mess. I've managed to do quite a lot so far.
>
> Thanks
> Matthew


--
- henrik
Re: Can the component name in a CQUERY be o verridden? [message #647997 is a reply to message #647976] Mon, 10 January 2011 17:32 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
I tested it, and you can't set the queried component using a property.
The advisor node can set a lot of things, but it doesn't look as though it can map the component name.

I ended up with a script that downloads and edits a copy of the CQUERY; I don't really like that, but it works ok. I will also see whether I can do anything with an MSEPC.

Thanks
Matthew
icon14.gif  Re: Can the component name in a CQUERY be o verridden? [message #647999 is a reply to message #647997] Mon, 10 January 2011 17:44 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
OK, I just worked out how to do it. I edited the CQUERY so it specifies a component name of ${user_config}.

Then when I invoke buckminster, I do it as follows:
java -Duser_config=i24-config -Dbuckminster.output.root=${WORKSPACE}/buckminster.output -Dbuckminster.temp.root=${WORKSPACE}/buckminster.temp -Xmx256m -jar /dls_sw/apps/buckminster/current/plugins/org.eclipse.equinox .launcher_1.1.1.R36x_v20101122_1400.jar -keyring ~/.gda/.keyring -application org.eclipse.buckminster.cmdline.headless --loglevel debug -data ${WORKSPACE} --scriptfile ${COMMAND_FILE}

The key point here is that the substitution only works when user_config is specified as a a Java system property. The substitution is not done when user_config is an ordinary enviroment variable. I wonder if that should be considered a bug? Anyhow, I have a work-around.

Matthew
Re: Can the component name in a CQUERY be o verridden? [message #648108 is a reply to message #647999] Tue, 11 January 2011 09:17 Go to previous messageGo to next message
Johannes Utzig is currently offline Johannes UtzigFriend
Messages: 329
Registered: July 2009
Senior Member
Am 10.01.2011 18:44, schrieb Matthew Webber:
> The key point here is that the substitution only works when user_config
> is specified as a a Java system property. The substitution is not done
> when user_config is an ordinary enviroment variable. I wonder if that
> should be considered a bug? Anyhow, I have a work-around.

Hi Matthew,

Environment Variables should be supported in latest buckminster versions:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329628

The replacement of environment variables is done in alignment with the
eclipse variables mechanism, i.e. they are prefixed.
${user_config} would become ${env_var:user_config}

Hope that works for you

Best regards,
Johannes
Re: Can the component name in a CQUERY be o verridden? [message #648190 is a reply to message #648108] Tue, 11 January 2011 17:11 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
> The replacement of environment variables is done in alignment with the
> eclipse variables mechanism, i.e. they are prefixed.
> ${user_config} would become ${env_var:user_config}

Hi Johannes,
Thanks for the quick response; the use of env_var would be very useful to me. Unfortunately my initial test was not so successful:

I specified a component name of ${env_var:gdacomponent} in my CQUERY, but when Itried to materialise it I got:
java.lang.IllegalArgumentException: can't parse argument number env_var:gdacomponent

I was not able to get the ${env_var:name} syntax to work in any context. This is with the latest released Buckminster.

Any suggestions?
Thanks
Re: Can the component name in a CQUERY be o verridden? [message #648219 is a reply to message #648190] Tue, 11 January 2011 20:21 Go to previous messageGo to next message
Johannes Utzig is currently offline Johannes UtzigFriend
Messages: 329
Registered: July 2009
Senior Member
Hi Matthew

On 11.01.2011 18:11, Matthew Webber wrote:
> I was not able to get the ${env_var:name} syntax to work in any context.
> This is with the latest released Buckminster.

Adding support for environment variables was not a bugfix but a new
feature really, so I applied the fix only to TRUNK and not in the Helios
Branch.
Unfortunately that means you will need to wait for the 3.7 release or
use an unreleased version in the meantime (which would currently mean to
build one yourself since there is AFAIK no milestone build available yet).

Best regards,
Johannes
Re: Can the component name in a CQUERY be o verridden? [message #648229 is a reply to message #648219] Tue, 11 January 2011 21:59 Go to previous message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
No worries Johannes. Thanks for the clarification. I look forward to 3.7!
Matthew
Previous Topic:Order of precedence for properties
Next Topic:[Resolved]Problem during meta-data refresh "Profile TARGET_DEFINITION is not current"
Goto Forum:
  


Current Time: Thu Apr 25 19:10:54 GMT 2024

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

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

Back to the top