Any way to insert SCM revision # as qualifier per plugin/feature not globally? [message #37923] |
Tue, 16 December 2008 17:32  |
Eclipse User |
|
|
|
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 10:30  |
Eclipse User |
|
|
|
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] |
Tue, 16 December 2008 21:40  |
Eclipse User |
|
|
|
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 10:30  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.08495 seconds