Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Replacing text at feature build time
Replacing text at feature build time [message #382745] Thu, 05 February 2009 20:27 Go to next message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Using Buckminster to build an update site that contains various
features for an RCP Product. To note the release and build of the
feature, I would like to do something like do something like

<replace file="<a feature's branding plugin>/about.mappings">
<replacefilter
token="0.0.0"
value="${product.version}"/>
<replacefilter
token="qualifier"
value="v${DSTAMP}${TSTAMP}"/>
</replace>


where my about.mapping looks like

# about.mappings
# contains fill-ins for about.properties
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
# This mapping the product release
0=0.0.0
1=qualifier


Can I do this with buckminster?

thanks for any help,
John
Re: Replacing text at feature build time [message #382747 is a reply to message #382745] Thu, 05 February 2009 21:38 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi John,
You can call ant from buckminster to do replacements like the one in
your example by just defining an ant actor in a CSPEC or CSPEX and make
sure that this action is then a prerequisite in your build.

Try adding something like:

<cs:artifacts>
<cs:private name="unqualified.about" path="about.mappings"/>
</cs:artifact>

<cs:actions>
<cs:public name="qualified.about" actor="ant">
<cs:actorProperties>
<cs:property key="buildFile" value="your-build.xml"/>
</cs:actorProperties>
<cs:properties>
<cs:property key="product.version" value="1.2.3"/>
</cs:properties>
<cs:prerequisites>
<cs:attribute name="unqualified.about" alias="action.input"/>
</cs:prerequisites>
<cs:products alias="action.output" base="generated/">
<cs:path path="about.mappings"/>
</cs:products>
</cs:public>
</cs:actions>

Your ant script can then copy the ${sp:action.input} file to
${sp:action.output} and run the replace command.

${sp:xxx} in this context refers to "Single Property named xxx" as
opposed to ${fs:xxx} which would be a "File Set named xxx".

Once you've done that, you can create new actions or groups that use the
"qualified.about" as a prerequisite.

Regards,
Thomas Hallgren


John E. Conlon wrote:
> Using Buckminster to build an update site that contains various features
> for an RCP Product. To note the release and build of the feature, I
> would like to do something like do something like
>
> <replace file="<a feature's branding plugin>/about.mappings">
> <replacefilter
> token="0.0.0"
> value="${product.version}"/>
> <replacefilter
> token="qualifier"
> value="v${DSTAMP}${TSTAMP}"/>
> </replace>
>
>
> where my about.mapping looks like
>
> # about.mappings
> # contains fill-ins for about.properties
> # java.io.Properties file (ISO 8859-1 with "\" escapes)
> # This file does not need to be translated.
> # This mapping the product release
> 0=0.0.0
> 1=qualifier
>
>
> Can I do this with buckminster?
>
> thanks for any help,
> John
Re: Replacing text at feature build time [message #382750 is a reply to message #382747] Thu, 05 February 2009 23:38 Go to previous message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Hi Thomas,

Sorry, I guess I did not explain clearly, that this is complicated by
the fact that the about.mapping file is in the branding plugin of this
feature. And this branding plugin is bundled prior (as prerequisite) to
the feature actions running.

To set these two variables in the plugin I would need to know the
version and the qualifier of the feature.

As I understand it:

1. The feature qualifier is created in the manifest action of the
generated feature cspec. This calls the target expand.feature.version.

2. The final group action run on a feature is the feature.exports.

So (Please correct me if I am wrong) it Looks like I will have to unjar
my branding plugin and do the replace then rejar it back up. And make
this new action a prerequisite to features.group using a cspex like:
<alterGroups>
<public name="feature.exports" rebase="${buckminster.output}/site/">
<attribute name="unqualified.about"/>
</public>
</alterGroups>

What is the best way to get the
a. feature version value;
b. feature qualifier value;
c. location references to the branding plugin
into my external ant action?


Couple of Additional questions:
PDE Build has a concept of a 'Feature Version Suffix' which is set by
the generateFeatureVersionSuffix=true. Does Buckminster do something
similar?

Is there a document describing all the properties that can be set in
external properties files?

thanks for all the help,
John



Thomas Hallgren wrote:
> Hi John,
> You can call ant from buckminster to do replacements like the one in
> your example by just defining an ant actor in a CSPEC or CSPEX and make
> sure that this action is then a prerequisite in your build.
>
> Try adding something like:
>
> <cs:artifacts>
> <cs:private name="unqualified.about" path="about.mappings"/>
> </cs:artifact>
>
> <cs:actions>
> <cs:public name="qualified.about" actor="ant">
> <cs:actorProperties>
> <cs:property key="buildFile" value="your-build.xml"/>
> </cs:actorProperties>
> <cs:properties>
> <cs:property key="product.version" value="1.2.3"/>
> </cs:properties>
> <cs:prerequisites>
> <cs:attribute name="unqualified.about" alias="action.input"/>
> </cs:prerequisites>
> <cs:products alias="action.output" base="generated/">
> <cs:path path="about.mappings"/>
> </cs:products>
> </cs:public>
> </cs:actions>
>
> Your ant script can then copy the ${sp:action.input} file to
> ${sp:action.output} and run the replace command.
>
> ${sp:xxx} in this context refers to "Single Property named xxx" as
> opposed to ${fs:xxx} which would be a "File Set named xxx".
>
> Once you've done that, you can create new actions or groups that use the
> "qualified.about" as a prerequisite.
>
> Regards,
> Thomas Hallgren
>
>
> John E. Conlon wrote:
>> Using Buckminster to build an update site that contains various
>> features for an RCP Product. To note the release and build of the
>> feature, I would like to do something like do something like
>>
>> <replace file="<a feature's branding plugin>/about.mappings">
>> <replacefilter
>> token="0.0.0"
>> value="${product.version}"/>
>> <replacefilter
>> token="qualifier"
>> value="v${DSTAMP}${TSTAMP}"/>
>> </replace>
>>
>>
>> where my about.mapping looks like
>>
>> # about.mappings
>> # contains fill-ins for about.properties
>> # java.io.Properties file (ISO 8859-1 with "\" escapes)
>> # This file does not need to be translated.
>> # This mapping the product release
>> 0=0.0.0
>> 1=qualifier
>>
>>
>> Can I do this with buckminster?
>>
>> thanks for any help,
>> John
Previous Topic:Build reproducibility - Materialize/Resolve from BOM but with different repositories
Next Topic:Buckminster Headless - configuration problem
Goto Forum:
  


Current Time: Fri Apr 26 06:21:40 GMT 2024

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

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

Back to the top