Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 66570 invoked from network); 8 Jun 2004 07:02:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Jun 2004 07:02:29 -0000 Received: (qmail 37090 invoked by uid 500); 8 Jun 2004 07:02:31 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 37028 invoked by uid 500); 8 Jun 2004 07:02:30 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 37011 invoked by uid 99); 8 Jun 2004 07:02:30 -0000 Received: from [66.111.0.243] (HELO confixx.bestiole.ch) (66.111.0.243) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 08 Jun 2004 00:02:30 -0700 Received: from [192.168.0.161] (michel.wod.ch [62.220.137.25]) by confixx.bestiole.ch (8.11.6/8.11.6) with ESMTP id i5871r422872 for ; Tue, 8 Jun 2004 09:01:53 +0200 Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <40C55D78.4070602@apache.org> References: <40C42D89.9070700@apache.org> <40C47C50.10102@apache.org> <42997.10.0.0.5.1086627339.squirrel@ags01.agsoftware.dnsalias.com> <40C4DC79.4060101@apache.org> <43496.10.0.0.5.1086653827.squirrel@ags01.agsoftware.dnsalias.com> <40C55D78.4070602@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Bertrand Delacretaz Subject: Use of the what command with java code (was: Including source files in jars) Date: Tue, 8 Jun 2004 09:01:50 +0200 To: dev@cocoon.apache.org X-Mailer: Apple Mail (2.613) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Le 8 juin 04, =E0 08:32, Sylvain Wallez a =E9crit : > ...You can know when the build was done by looking at the class files=20= > creation date in the jars, but you cannot know what sources were used=20= > to produce them, except that they're older than the build. But how=20 > much older? Was the checkout done a day before or a week? Also, was it=20= > a full cvs update or only a partial one (e.g. on a particular=20 > block)?... In the Good Old Times (C++ programming under unix) we were using the=20 "what" command to tell us from which versions of source files our=20 binaries were built (see "man what" for more info if you're running a=20 decent platform) (I know I'll get flamed for saying "decent" ;-) A quick test shows that this works with java as well, using unzip -p to=20= decompress jars before letting "what" process their content. g4:/tmp> cat A.java class A { public static final String WHAT_ID =3D "@(#)$Id: A.java,v 1.3=20= 1999/07/08 14:16:07 sylvain Exp $"; public static void main(String args[]) { System.out.println(WHAT_ID); } } g4:/tmp> javac A.java g4:/tmp> what A.class A.class $Id: A.java,v 1.3 1999/07/08 14:16:07 sylvain Exp $ g4:/tmp> jar cvf a.jar A.class . . . g4:/tmp> unzip -p a.jar | what $Id: A.java,v 1.3 1999/07/08 14:16:07 sylvain Exp $ So I think, by simply adding WHAT_ID strings to our source files we=20 could have this info without having to include source code in jars (but=20= of course, your solution works *now* ;-) -Bertrand