Stefan Groschupf wrote:

After importing this into Nutch CVS this will get expanded
to different values

I know that is the sense of this tags, isnt it. I really miss this kind of header in nutch source code since all os projects i was involved had such headers.

I agree - I miss them too... My point was that we should do it in an orderly manner.


I have good experiences in using just the $Id$ lines, because they provide a lot of information without taking too much space. Some projects like to stick $Author$, $Revision$, some others even go overboard and include $Log$ (pretty dumb idea, if you ask me...), but $Id$ IMHO provides a good balance.

Here's an example of an $Id$ line:

/* $Id: PaymentRegHome.java,v 1.11 2001/05/22 10:59:35 thomas_n Exp $ */

It lists the current revision number, its commit date and who committed the change. If you need more information, this included information is sufficient to get it by "cvs log | status | diff".

Some projects use a trick (inherited from C) to stick the $Id$ into a public static final String, or to use a getVersion() method on every class. This has the benefit that you can check the revision number even when you only have a binary JAR, and also during runtime (using reflection). The downside is that you have to add these fields/methods to every single class... ugly, methinks. Yet another, more complicated approach, is to create and add to the JAR a BuildVersion.class, which contains all collected $Id$ from each package, and provides methods to retrieve them... Some other projects like to stick this info into JAR Manifest entries, using a custom doclet to collect all @version tags, which gives a similar functionality without polluting the code. It does not work so easily for non-Java resources, but some Ant magic can be devised to support them too - that's the solution I'd propose.

So, for the start, I propose to add @version $Id$ lines to the headers of all Java files, and to put them in the JAR manifest entries. Other resources supporting comments (*.xml, *.properties, *.txt, *.html) need probably a different solution to collect their $Id$. In my opinion, this is a very useful information when distributing a release (not always you have the CVS access to check which version was included in the release).

--
Best regards,
Andrzej Bialecki

-------------------------------------------------
Software Architect, System Integration Specialist
CEN/ISSS EC Workshop, ECIMF project chair
EU FP6 E-Commerce Expert/Evaluator
-------------------------------------------------
FreeBSD developer (http://www.freebsd.org)



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to