How to include component version with an action path [message #480867] |
Tue, 18 August 2009 13:55  |
Eclipse User |
|
|
|
Hi,
I'm adding an action to a feature component, via a cspex, that generates a
product archive, much like the mailapp tutorial. I want the archive name to
include version and platform information. I've got the following so far
which adds the platform information.
<cs:public name="product.install.archive" actor="ant">
<cs:actorProperties>
<cs:property key="buildFile" value="build/product.ant"/>
<cs:property key="targets" value="product.install.archive"/>
</cs:actorProperties>
<cs:prerequisites alias="action.input">
<cs:attribute name="product.install"/>
</cs:prerequisites>
<cs:products alias="action.output"
base="${buckminster.output}/">
<cs:path
path="MailApp.${target.os}.${target.ws}.${target.arch}.zip"/ >
</cs:products>
</cs:public>
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.
Thanks,
Tas
|
|
|
|
Re: How to include component version with an action path [message #480953 is a reply to message #480909] |
Wed, 19 August 2009 03:31   |
Eclipse User |
|
|
|
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@tada.se> wrote in message
news:h6f4u4$j0u$1@build.eclipse.org...
> 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
|
|
|
|
Re: How to include component version with an action path [message #480978 is a reply to message #480974] |
Wed, 19 August 2009 04:57   |
Eclipse User |
|
|
|
Thomas,
Thanks. Using a folder sounds like a reasonable way forward; I can produce
multiple archives and give them a version number.
So at present I cannot access the qualifier, even from within an ant script
that implements an action?
Thanks,
Tas
"Thomas Hallgren" <thomas@tada.se> wrote in message
news:h6ge93$4c4$1@build.eclipse.org...
> Hi Tas,
>
> On 08/19/2009 09:31 AM, Tas Frangoullides wrote:
>> 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?
>>
> The way we solve that is to use a folder as the output path and then let
> the ant-script create the part of the name that includes the version.
>
>> 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?
>>
> We have some work in progress to make this kind of thing declarable (and
> of course runnable) in a cspec. I know it doesn't help you much right now
> but it might be good to know that it's coming.
>
> You can subscribe yourself to bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=286637 "Add ability to
> repeat actions with different input".
>
> Regards,
> Thomas Hallgren
|
|
|
Re: How to include component version with an action path [message #480987 is a reply to message #480978] |
Wed, 19 August 2009 05:26  |
Eclipse User |
|
|
|
On 08/19/2009 10:57 AM, Tas Frangoullides wrote:
> Thomas,
>
> Thanks. Using a folder sounds like a reasonable way forward; I can
> produce multiple archives and give them a version number.
>
> So at present I cannot access the qualifier, even from within an ant
> script that implements an action?
>
Not unless you pass the manifest.mf in which the qualifier resides.
- thomas
|
|
|
Powered by
FUDForum. Page generated in 0.03906 seconds