[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.buckminster] Re: How to include component version with an action path

Hi Thomas,

I did notice the extractFeatureVersion task but couldn't think of a way to use as part of an action's products. My current understanding of actions is that you need to pre-declare output paths and artifacts in the cspec/cspex, which means I need to know it before the action runs. It looks like a chicken and egg situation to me?

My end goal is to generate and publish multiple product zips during the build. Is this the sort of thing you'd place in a high-level build script, for example in a top-level releng component. If I had this component use the buckminster task to invoke the product archive task for each target platform would I be able to extract the version number (with qualifier) there as it is after the build of the site?

Thanks,
Tas


"Thomas Hallgren" <thomas@xxxxxxx> wrote in message news:h6f4u4$j0u$1@xxxxxxxxxxxxxxxxxxxx
Hi Tas,

On 08/18/2009 07:55 PM, Tas Frangoullides wrote:

Is this a good approach? I've gotten stuck now because I can't find a
property for the version of the component. I want the complete version
number with substituted qualifier.

The substituted qualifier is not available as a property since it is generated as part of the build. Ideally, the build should have several phases. A first one that computes things like that and creates a set of advices in a context and then the real build that have access to that context. This is a planned improvement but nothing that we have ready just yet. But there are other solutions that you might want to try.

The build.xml that is bundled with our PDE support contains two ant macros that you might find useful. The extractFeatureVersion and extractBundleVersion. Both takes two attributes. A 'file' from which to extract the version and a 'property' that will receive the extracted version.

You can get access to these macros by adding this line to your ant script:

<import file="${buckminster.pdetasks}"/>

and then you can extract a version with:

<extractFeatureVersion file="${sp:manifest}" property="feature.version"/>

For this to work, your cspec must pass the feature.xml file that contains the calculated qualifier using a prerequisite with alias="manifest".

HTH,
Thomas Hallgren