Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » automatically add svn revision number on bundle export
automatically add svn revision number on bundle export [message #495633] Thu, 05 November 2009 14:38 Go to next message
Thomas Haskes is currently offline Thomas Haskes
Messages: 147
Registered: July 2009
Senior Member
Hi all,

I couldn't find anything on google, which is why I ask here:

I would like to have eclipse autmatically add the svn revision number
to the bundle version when I export a Eclipse RCP Bundle/Plugin. I think
this could be done using the qualifier replacement but I don't know how.

The Bundle jar file should look like this after exporting

com.company.mybundle_1.0.0.rev1234

and not

com.company.mybundle_1.0.0.20091105-1535

Currently we manually add the svn revision number to the bundle using
the qualifier replacement, but developers often forget to do that. If
that bundle is shipped and has a bug, we have no chance to figure out
what bundle revision was shipped (the current date that is added by the
qualifier replacement as standard doesn't help much).

Does anyone know if that is possible and how it is done?

Regards,

Tom
Re: automatically add svn revision number on bundle export [message #495731 is a reply to message #495633] Thu, 05 November 2009 20:38 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew Niefer
Messages: 990
Registered: July 2009
Senior Member
Other than the field in the export wizard, all you can do is in the
bundle's build.properties file, set the property
qualifier=rev1234

Headless builds allow more flexibility here.

I don't know of any good ways to keep this property in-sync with the
revision (and perhaps also keep it out of source control).

-Andrew


Thomas Haskes wrote:
> Hi all,
>
> I couldn't find anything on google, which is why I ask here:
>
> I would like to have eclipse autmatically add the svn revision number
> to the bundle version when I export a Eclipse RCP Bundle/Plugin. I think
> this could be done using the qualifier replacement but I don't know how.
>
> The Bundle jar file should look like this after exporting
>
> com.company.mybundle_1.0.0.rev1234
>
> and not
>
> com.company.mybundle_1.0.0.20091105-1535
>
> Currently we manually add the svn revision number to the bundle using
> the qualifier replacement, but developers often forget to do that. If
> that bundle is shipped and has a bug, we have no chance to figure out
> what bundle revision was shipped (the current date that is added by the
> qualifier replacement as standard doesn't help much).
>
> Does anyone know if that is possible and how it is done?
>
> Regards,
>
> Tom
Re: automatically add svn revision number on bundle export [message #495790 is a reply to message #495731] Fri, 06 November 2009 06:29 Go to previous messageGo to next message
Volker Wegert is currently offline Volker Wegert
Messages: 169
Registered: July 2009
Senior Member
Andrew Niefer <aniefer@ca.ibm.com> writes:
> Thomas Haskes wrote:
>>
>> I would like to have eclipse autmatically add the svn revision number
>> to the bundle version when I export a Eclipse RCP Bundle/Plugin. I think
>> this could be done using the qualifier replacement but I don't know how.
>
> Other than the field in the export wizard, all you can do is in the bundle's
> build.properties file, set the property
> qualifier=rev1234
>
> Headless builds allow more flexibility here.
>
> I don't know of any good ways to keep this property in-sync with the revision
> (and perhaps also keep it out of source control).

> Thomas Haskes wrote:
>> Hi all,
>>
>> I couldn't find anything on google, which is why I ask here:
>>
>> I would like to have eclipse autmatically add the svn revision number
>> to the bundle version when I export a Eclipse RCP Bundle/Plugin. I think
>> this could be done using the qualifier replacement but I don't know how.
>>
>> The Bundle jar file should look like this after exporting
>>
>> com.company.mybundle_1.0.0.rev1234
>>
>> and not
>>
>> com.company.mybundle_1.0.0.20091105-1535
>>
>> Currently we manually add the svn revision number to the bundle using
>> the qualifier replacement, but developers often forget to do that. If
>> that bundle is shipped and has a bug, we have no chance to figure out
>> what bundle revision was shipped (the current date that is added by the
>> qualifier replacement as standard doesn't help much).
>>
>> Does anyone know if that is possible and how it is done?

Similar to CVS, just google for svn:keywords.

HTH
Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
"You need the computing power of a Pentium, 16 MB RAM and 1 GB Harddisk to run
Win95. It took the computing power of 3 Commodore 64 to fly to the
Moon. Something is wrong here, and it wasn't the Apollo."
Re: automatically add svn revision number on bundle export [message #512663 is a reply to message #495633] Fri, 05 February 2010 22:14 Go to previous message
John Borland is currently offline John Borland
Messages: 1
Registered: February 2010
Junior Member
I have a suggestion as well as a question of my own. I think you may be able to write an exportWizard plugin to do what you are trying to do. I haven't tried this myself, but it looks like a useful lead for you.

I have been working on the related problem of implanting a global svn revision number into source code. I wrote a CompilationParticipant to assist in this task, and during the aboutToBuild() method I retrieve the global svn revision number by exec'ing svnversion on the project directory and then implanting it into a text file in the source tree which is ignored by subversion. The text file can then be read into source code using Class.getResource().

The only hitch I have is that invoking svnversion on the project directory gives me a revision number with a "P" on the end, which indicates a sparse checkout. I'd like to get the revision number as it appears in the "SVN Info" tab of the project properties window. I am sure there must be a way to get this number programatically from within the plugin, but I haven't found it yet. I will post it if I find it.

Hope this information is useful.
Previous Topic:Problem with switch workspace
Next Topic:Can't launch RCP app from new Product Config
Goto Forum:
  


Current Time: Sat Sep 20 16:11:48 GMT 2014

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

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