Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Any way to insert SCM revision # as qualifier per plugin/feature not globally?
Any way to insert SCM revision # as qualifier per plugin/feature not globally? [message #37923] Tue, 16 December 2008 22:32 Go to next message
Chris Williams is currently offline Chris WilliamsFriend
Messages: 29
Registered: July 2009
Junior Member
In our builds we use the SVN revision number of the contents as the
context qualifier, so all our plugins and features share the revision as
their version suffix. That's nice, but it means that if we're only
actually working on one plugin, everything's version gets incremented.
Ideally I'd like to see each plugin/feature use the highest revision # of
the code in that project as it's qualifier.

Has anyone done this? Is it even possible, or does Eclipse's build process
sort of assume a global qualifier?
Re: Any way to insert SCM revision # as qualifier per plugin/feature not globally? [message #37988 is a reply to message #37923] Wed, 17 December 2008 02:40 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Hi Chris,

You'll need to execute svn info and get the last revision number of each
plugin/feature[1] and replace the .qualifier from the MANIFEST.MF and
feature.xml yourself with the svn revision number.

However you'll still need to increment the version number of your
feature.xml if one of it's plugin version changes or the feature will
not work off the 'update' site. I'm not sure how this can be achieved,
so I've settled for global version numbers.

I'll be watching this thread for any ideas.

-- Ketan

On 17/12/08 04:02, Chris Williams wrote:
> In our builds we use the SVN revision number of the contents as the
> context qualifier, so all our plugins and features share the revision as
> their version suffix. That's nice, but it means that if we're only
> actually working on one plugin, everything's version gets incremented.
> Ideally I'd like to see each plugin/feature use the highest revision #
> of the code in that project as it's qualifier.
>
> Has anyone done this? Is it even possible, or does Eclipse's build
> process sort of assume a global qualifier?
>
Re: Any way to insert SCM revision # as qualifier per plugin/feature not globall [message #48070 is a reply to message #37988] Wed, 25 February 2009 15:30 Go to previous message
Chris Williams is currently offline Chris WilliamsFriend
Messages: 29
Registered: July 2009
Junior Member
Ketan Padegaonkar wrote:

> You'll need to execute svn info and get the last revision number of each
> plugin/feature[1] and replace the .qualifier from the MANIFEST.MF and
> feature.xml yourself with the svn revision number.

In the spirit of sharing, I did manage to get this to work. I added an ant
target prior to the build target that grabs all the directories inside the
plugins and features folder of the build directory, and then runs an SVN
info and sticks the last changed rev into the plugin/feature's
build.properties as the value of "qualifier". I used ant-contrib's for
task to iterate through, and a regexpreplace to replace
"qualifier\s*=\s*context" with "qualifier=${plugin.name.svn.rev}". The way
it works, it doesn't handle when the qualifier property doesn't already
exist (which is equivalent to setting qualifier to context), so I had to
make sure that line was in all the build.properties.

My guess is that a slightly better way would be to add this inside a
customTarget for the build, not as a postFetch, but as a
preWhateverComesNext (because postFetch doesn't get called if you don't
actually fetch source as part of the build, which we don't because we use
a continuous build machine).

> However you'll still need to increment the version number of your
> feature.xml if one of it's plugin version changes or the feature will
> not work off the 'update' site. I'm not sure how this can be achieved,
> so I've settled for global version numbers.

There's a handy PDE Build property for this:
"generateFeatureVersionSuffix=true". It generates a long suffix string of
gobble-dee-gook at the end of the feature and is supposed to increment as
the contents of the feature do. One thing to note is that the feature
needs a qualifier set (that means no "qualifier=none") or the suffix won't
get generated. Don't ask me why.

-Chris
Re: Any way to insert SCM revision # as qualifier per plugin/feature not globally? [message #587286 is a reply to message #37923] Wed, 17 December 2008 02:40 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Hi Chris,

You'll need to execute svn info and get the last revision number of each
plugin/feature[1] and replace the .qualifier from the MANIFEST.MF and
feature.xml yourself with the svn revision number.

However you'll still need to increment the version number of your
feature.xml if one of it's plugin version changes or the feature will
not work off the 'update' site. I'm not sure how this can be achieved,
so I've settled for global version numbers.

I'll be watching this thread for any ideas.

-- Ketan

On 17/12/08 04:02, Chris Williams wrote:
> In our builds we use the SVN revision number of the contents as the
> context qualifier, so all our plugins and features share the revision as
> their version suffix. That's nice, but it means that if we're only
> actually working on one plugin, everything's version gets incremented.
> Ideally I'd like to see each plugin/feature use the highest revision #
> of the code in that project as it's qualifier.
>
> Has anyone done this? Is it even possible, or does Eclipse's build
> process sort of assume a global qualifier?
>
Re: Any way to insert SCM revision # as qualifier per plugin/feature not globall [message #592337 is a reply to message #37988] Wed, 25 February 2009 15:30 Go to previous message
Chris Williams is currently offline Chris WilliamsFriend
Messages: 29
Registered: July 2009
Junior Member
Ketan Padegaonkar wrote:

> You'll need to execute svn info and get the last revision number of each
> plugin/feature[1] and replace the .qualifier from the MANIFEST.MF and
> feature.xml yourself with the svn revision number.

In the spirit of sharing, I did manage to get this to work. I added an ant
target prior to the build target that grabs all the directories inside the
plugins and features folder of the build directory, and then runs an SVN
info and sticks the last changed rev into the plugin/feature's
build.properties as the value of "qualifier". I used ant-contrib's for
task to iterate through, and a regexpreplace to replace
"qualifier\s*=\s*context" with "qualifier=${plugin.name.svn.rev}". The way
it works, it doesn't handle when the qualifier property doesn't already
exist (which is equivalent to setting qualifier to context), so I had to
make sure that line was in all the build.properties.

My guess is that a slightly better way would be to add this inside a
customTarget for the build, not as a postFetch, but as a
preWhateverComesNext (because postFetch doesn't get called if you don't
actually fetch source as part of the build, which we don't because we use
a continuous build machine).

> However you'll still need to increment the version number of your
> feature.xml if one of it's plugin version changes or the feature will
> not work off the 'update' site. I'm not sure how this can be achieved,
> so I've settled for global version numbers.

There's a handy PDE Build property for this:
"generateFeatureVersionSuffix=true". It generates a long suffix string of
gobble-dee-gook at the end of the feature and is supposed to increment as
the contents of the feature do. One thing to note is that the feature
needs a qualifier set (that means no "qualifier=none") or the suffix won't
get generated. Don't ask me why.

-Chris
Previous Topic:massive Ganymede update problem on Linux / MAC OS
Next Topic:Blocking problems w/a p2 based RCP product-Updates locked/feature install breaks
Goto Forum:
  


Current Time: Wed Jul 28 11:34:58 GMT 2021

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

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

Back to the top