Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Qualifier replacement when SCM is Git
Qualifier replacement when SCM is Git [message #768667] Tue, 20 December 2011 15:24 Go to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
Our buckminster properties file specifies
qualifier.replacement.*=generator:lastRevision

This works quite well for components that were checked out from subversion - the jars get build with names like my.plugin_1.0.0.r12345.jar. Here, 12345 is the subversion revision number for the most recent revision for that plugin.

However, it does not work at all for components that were checked out from Git - the jars get build with names like my.plugin_1.0.0.qualifier.jar.

Git of course does not have revision numbers, but I expected that the qualifier would be replaced by the SHA1 hash that Git uses as a sort of revision number equivalent.

Is there a way that I can get that to work? If not, what's the alternative? Does generator.lastModified work for Git?

Thanks
Re: Qualifier replacement when SCM is Git [message #768669 is a reply to message #768667] Tue, 20 December 2011 15:28 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
I just noticed that the BuckyBook implies that generator.lastRevision expects that it is formatting a number. I guess that's the problem, since the Git hash is alphanumeric.
Re: Qualifier replacement when SCM is Git [message #768716 is a reply to message #768669] Tue, 20 December 2011 16:46 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Looking at what we have set for project Geppetto (that lives in git),
and the settings we have are:

qualifier.replacement.*=generator:lastModified
generator.lastModified.format='v'yyyyMMdd-HHmm

- henrik

On 2011-20-12 16:28, Matthew Webber wrote:
> I just noticed that the BuckyBook implies that generator.lastRevision
> expects that it is formatting a number. I guess that's the problem,
> since the Git hash is alphanumeric.
>
icon14.gif  Re: Qualifier replacement when SCM is Git [message #768725 is a reply to message #768716] Tue, 20 December 2011 17:02 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
Thanks Henrik. I just tried that, and it works fine. Theoretically you could have two commits within 1 minute, so the qualifier does not quite uniquely identify the state of the repository, but it's good enough for us.
Matthew
Re: Qualifier replacement when SCM is Git [message #768755 is a reply to message #768725] Tue, 20 December 2011 18:05 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
The qualifier format is a standard SimpleDateFormat so feel free to add
both seconds (and microseconds ;-) ) if you feel that's needed.

- thomas

On 2011-12-20 18:02, Matthew Webber wrote:
> Thanks Henrik. I just tried that, and it works fine. Theoretically you
> could have two commits within 1 minute, so the qualifier does not quite
> uniquely identify the state of the repository, but it's good enough for us.
> Matthew
>
Re: Qualifier replacement when SCM is Git [message #768758 is a reply to message #768667] Tue, 20 December 2011 18:07 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
On 2011-12-20 16:24, Matthew Webber wrote:
> Git of course does not have revision numbers, but I expected that the
> qualifier would be replaced by the SHA1 hash that Git uses as a sort of
> revision number equivalent.
>
The SHA1 is useless because it doesn't reflect an increasing magnitude.
Thus, using it you would get versions that are actually less than the
previous one. Hence the need for lastModified rather than lastRevision
when using git.

- thomas
Re: Qualifier replacement when SCM is Git [message #771903 is a reply to message #768758] Wed, 28 December 2011 13:37 Go to previous messageGo to next message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
On 12/20/2011 07:07 PM, Thomas Hallgren wrote:
> On 2011-12-20 16:24, Matthew Webber wrote:
>> Git of course does not have revision numbers, but I expected that the
>> qualifier would be replaced by the SHA1 hash that Git uses as a sort of
>> revision number equivalent.
>>
> The SHA1 is useless because it doesn't reflect an increasing magnitude.
> Thus, using it you would get versions that are actually less than the
> previous one. Hence the need for lastModified rather than lastRevision
> when using git.

Wouldn't it be possible to implement a qualifier replacement which
extracted the timestamp from the time of the latest commit (in the
plugin/feature)?

--
/Jesper
Re: Qualifier replacement when SCM is Git [message #771944 is a reply to message #771903] Wed, 28 December 2011 15:56 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
On 2011-12-28 14:37, Jesper Eskilson wrote:
> On 12/20/2011 07:07 PM, Thomas Hallgren wrote:
>> On 2011-12-20 16:24, Matthew Webber wrote:
>>> Git of course does not have revision numbers, but I expected that the
>>> qualifier would be replaced by the SHA1 hash that Git uses as a sort of
>>> revision number equivalent.
>>>
>> The SHA1 is useless because it doesn't reflect an increasing magnitude.
>> Thus, using it you would get versions that are actually less than the
>> previous one. Hence the need for lastModified rather than lastRevision
>> when using git.
>
> Wouldn't it be possible to implement a qualifier replacement which extracted the timestamp from the time of the latest
> commit (in the plugin/feature)?
>
That's exactly what the lastModified does.

- thomas
Re: Qualifier replacement when SCM is Git [message #772221 is a reply to message #771944] Thu, 29 December 2011 09:31 Go to previous message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
On 12/28/2011 04:56 PM, Thomas Hallgren wrote:
> On 2011-12-28 14:37, Jesper Eskilson wrote:
>> On 12/20/2011 07:07 PM, Thomas Hallgren wrote:
>>> On 2011-12-20 16:24, Matthew Webber wrote:
>>>> Git of course does not have revision numbers, but I expected that the
>>>> qualifier would be replaced by the SHA1 hash that Git uses as a sort of
>>>> revision number equivalent.
>>>>
>>> The SHA1 is useless because it doesn't reflect an increasing magnitude.
>>> Thus, using it you would get versions that are actually less than the
>>> previous one. Hence the need for lastModified rather than lastRevision
>>> when using git.
>>
>> Wouldn't it be possible to implement a qualifier replacement which
>> extracted the timestamp from the time of the latest
>> commit (in the plugin/feature)?
>>
> That's exactly what the lastModified does.

Aha. Cool.

/Jesper
Previous Topic:Can Buckminster build Eclipse RCP Plug-in projects containing jars with dynamic file names?
Next Topic:How do you run findbugs in buckminster build?
Goto Forum:
  


Current Time: Thu Apr 25 14:20:13 GMT 2024

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

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

Back to the top