Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Get the product version in customBuildCallbacks.xml
Get the product version in customBuildCallbacks.xml [message #483629] Wed, 02 September 2009 12:05 Go to next message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi all,

In my RCP application, I want to insert dynamic values in the about
dialog. I created and added in my build an about.mappings file.

> 0=@version@
> 1=@buildId@


I then created a customBuildCallbacks.xml file where I have overriden
the build ID. It works. However, the version is not overriden. I thought
it was made by default. I then tried to modify the ...callbacks.xml but
I cannot manage to get the product version in my script.

> <target name="pre.gather.bin.parts">
> <tstamp>
> <format property="TODAY" pattern="yyyyMMdd-HHmmss" />
> </tstamp>
> <replace file="about.mappings">
> <replacefilter token="@buildId@" value="Alpha Build v${TODAY}" />
> <replacefilter token="@version@" value="${productVersion}" />
> </replace>
> </target>


${productVersion} is not a valid property, and I could not find a such
one. Is it possible to get the product version in the ...callbacks.xml file?

What I would like to do is centralize and avoid duplicates while setting
properties. More precisely, I would like to set the product version only
once (either in the ...callbacks.xml, or in the product definition, but
not in both).

Another solution could be to set @version@ in the product definition and
override it in the build. Just to mention it, I am running the product
build from Eclipse with the PDE export wizard (headless build will come
later on).


Any idea on how I can get the product version?


Regards,

Vincent Zurczak.


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Re: Get the product version in customBuildCallbacks.xml [message #483722 is a reply to message #483629] Wed, 02 September 2009 17:16 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

OK
I finally managed to do that, by using ANT tasks.

For those who would have the same issue, here is how I do that in my
CustomBuildCallbacks.xml file:


> <target name="pre.gather.bin.parts">
> <!-- Load the product file to get the product version -->
> <xmlproperty file="petals-studio.product" />
>
> <!-- Backup mappings and replace values -->
> <copy file="about.mappings" tofile="about.mappings.backup" />
> <tstamp>
> <format property="TODAY" pattern="yyyyMMdd-HHmmss" />
> </tstamp>
> <replace file="about.mappings">
> <replacefilter token="@buildId@" value="Alpha Build v${TODAY}" />
> <replacefilter token="@version@" value="${product(version)}" />
> </replace>
> </target>




Vincent.





Vincent Zurczak a écrit :
> Hi all,
>
> In my RCP application, I want to insert dynamic values in the about
> dialog. I created and added in my build an about.mappings file.
>
>> 0=@version@
>> 1=@buildId@
>
>
> I then created a customBuildCallbacks.xml file where I have overriden
> the build ID. It works. However, the version is not overriden. I thought
> it was made by default. I then tried to modify the ...callbacks.xml but
> I cannot manage to get the product version in my script.
>
>> <target name="pre.gather.bin.parts">
>> <tstamp>
>> <format property="TODAY" pattern="yyyyMMdd-HHmmss" />
>> </tstamp>
>> <replace file="about.mappings">
>> <replacefilter token="@buildId@" value="Alpha Build v${TODAY}" />
>> <replacefilter token="@version@" value="${productVersion}" />
>> </replace>
>> </target>
>
>
> ${productVersion} is not a valid property, and I could not find a such
> one. Is it possible to get the product version in the ...callbacks.xml
> file?
>
> What I would like to do is centralize and avoid duplicates while setting
> properties. More precisely, I would like to set the product version only
> once (either in the ...callbacks.xml, or in the product definition, but
> not in both).
>
> Another solution could be to set @version@ in the product definition and
> override it in the build. Just to mention it, I am running the product
> build from Eclipse with the PDE export wizard (headless build will come
> later on).
>
>
> Any idea on how I can get the product version?
>
>
> Regards,
>
> Vincent Zurczak.
>
>


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Previous Topic:3.5 Stand Alone RCP Missing Bundles
Next Topic:Create a Combo in the CoolBar of the RCP
Goto Forum:
  


Current Time: Sat Apr 20 01:44:09 GMT 2024

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

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

Back to the top