Generate version Id in a file

C

cyber Boy

Hello,

I would like to automaticaly generate version Id in doc comments in a source
file and I don't know how can I do this.

For example:
org.springframework.security.providers.AuthenticationProvider class

@version $Id: AuthenticationProvider.java 2217 2007-10-27 00:45:30Z luke_t $

I suppose that 2217 is build number and 2007-10-27 is build date and
00:45:30 is build time.
Is that right ?

What I need to do for automaticaly generate this information ?

Regards,
cyber1boy
 
T

Thomas Kellerer

cyber Boy, 14.01.2009 10:32:
Hello,

I would like to automaticaly generate version Id in doc comments in a source
file and I don't know how can I do this.

For example:
org.springframework.security.providers.AuthenticationProvider class

@version $Id: AuthenticationProvider.java 2217 2007-10-27 00:45:30Z luke_t $

I suppose that 2217 is build number and 2007-10-27 is build date and
00:45:30 is build time.
Is that right ?

I would strongly assume that that information is added by the version control system (cvs, svn) when the file gets committed. It is most probably _not_ the build date and time.

Thomas
 
C

cyber Boy

I explored a little bit more and I thing that is not the build time also. It
doesn't make sence.
I thik that is change time.
In Eclipse exist Code Templates. Maybe this is solution.

cyber1boy
 
L

Lew

cyber said:
I explored a little bit more and I thing that is not the build time also. It
doesn't make sence.
I thik that is change time.
In Eclipse exist Code Templates. Maybe this is solution.

Please do not top-post.

What about the Javadocs @version tag?
 
C

cyber Boy

Lew said:
What about the Javadocs @version tag?


I would like to implement automaticaly generation for @version tag.
Example:
@version $Id: AuthenticationProvider.java 2217 2007-10-27 00:45:30Z luke_t $

Some informations in this tag are dinamicaly.

cyber1boy
 
L

Lew

I would like to implement automaticaly generation for @version tag.
Example:
@version $Id: AuthenticationProvider.java 2217 2007-10-27 00:45:30Z luke_t $

Some informations in this tag are dinamicaly.

Your use of $Id$ implies that you can also use $Revision$. This is a
revision-control-dependent feature, though.
 
D

Daniel Pitts

Thomas said:
cyber Boy, 14.01.2009 10:32:

I would strongly assume that that information is added by the version
control system (cvs, svn) when the file gets committed. It is most
probably _not_ the build date and time.

Thomas
That is my conclusion too.
 
L

Lew

Daniel said:
That is my conclusion too.

The CVS manual
<http://ximbiot.com/cvs/wiki/CVS--Concurrent Versions System
%20v1.12.12.1%3A%20Keyword%20substitution>
says that:
Embedded strings of the form $ keyword $ and $ keyword :…$ in a file
are replaced with strings of the form $ keyword : value $
whenever you obtain a new revision of the file.

So the keyword replacement occurs when you obtain the file from the
version-control (VC) system, although the values themselves
undoubtedly are recorded in the VC system at commit time. At least
for CVS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top