Re: does anyone use ident on jar files?
- From: Andreas Leitgeb <avl@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 21 Aug 2008 11:44:10 GMT
marlow.andrew@xxxxxxxxxxxxxx <marlow.andrew@xxxxxxxxxxxxxx> wrote:
Andreas Leitgeb wrote:
When checking out, e.g. from CVS, run "cvs stat" on your
work-directory, possibly post-process it to extract only
the interesting parts, and include this "bill of material"
into the zip-file. (This isn't really related to the specific
sub-topic of using annotations, but anyway, I know a project
where it is really done that way. - This saves the chores of
having to add a version-string into every single source-file.
The bill-of-material file is created autmatically from the ant
build.xml script for each full-compile.)
Is this related to the manifest that every jar has?
No, the b-o-m I mentioned is a separate file, containing the output
of "cvs stat"
There is some target "cvs_stat" which contains this tag:
<cvs dest="${project.path}" command="stat" quiet="true"
output="project.bom" append="false"/>
This target "cvs_stat" is mentioned in the depends-list of some
other targets. The output file project.bom is mentioned in
the list of things to add to the "project.jar".
But I am told that the manifest might be
able to help me somehow.
The Manifest is some kind of property file with some(?)
obligatory entries, and freedom to add almost any number
more. It's entirely feasible to add the name and cvs-version
of each file as key-value pairs to that file.
However, I think it's better practice to use a different
file project.bom, and it gives you more freedom for the
format for the latter (as it need not be property-file format).
The approach you describe would work but I have never heard of
anyone else doing it.
Neither have I :-) But I think it's so naturally easy, that
surely others also must have thought about it.
Also it sounds like a bit of extra work that might not be
appreciated where I am right now (but thanks for the suggestion,
it's an interesting idea).
While it is some work to set it up (requires some knowledge about
customizing build-scripts), I think it is *much* less work than
adding CVS-version strings to each and every .java source file,
not to mention the advantage of having the info also about those
files that cannot be "version-stringified", like gif images...
You take advantage of the fact that java-programs are shipped as
zip-files, which can easily contain extra files, and each file will
only be uncompressed to memory when it is actually accessed.
You just don't have that opportunity with native aout/coff/elf/...-
style program-binaries.
To extract the information, you extract the .bom file from the
archive and open it in any text-viewer/editor of your likings.
.
- References:
- does anyone use ident on jar files?
- From: marlow . andrew
- Re: does anyone use ident on jar files?
- From: Andreas Leitgeb
- Re: does anyone use ident on jar files?
- From: marlow . andrew
- Re: does anyone use ident on jar files?
- From: marlow . andrew
- does anyone use ident on jar files?
- Prev by Date: Good OO design
- Next by Date: Re: The mac for Java programmers
- Previous by thread: Re: does anyone use ident on jar files?
- Next by thread: Re: does anyone use ident on jar files?
- Index(es):
Relevant Pages
|