Re: does anyone use ident on jar files?



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.

.



Relevant Pages

  • Read ZIP in ZIP about MemoryStream
    ... I would like to read a zip-file how is stored in a zip-file. ... with zip-files I use the ScharpZipLib, this is a great utility for ... I have no problem to extract all files to a folder, ... file on file step by step to the memory. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: tt:mm:ss interferes with defined range?
    ... In Column data format select Do not import ... This will extract the unique dates in ascending order. ... You can use this data for you chart. ... Microsoft Excel MVP ...
    (microsoft.public.excel)
  • Re: Exporting DV using Toast
    ... presents, so I extracted the footage from them in DV format using Toast, ... edited them using Final Cut Pro, and mastered and burnt them using iDVD. ... went well until playing the final disc image with DVD player, ... I've used Toast because it seems to be the only thing that will extract DV ...
    (uk.comp.sys.mac)
  • Re: What is the preferred way to parse messages out of a log?
    ... I need to extract the values of the message and ... format, provide searching and message grouping by the dialogID. ... Trunk Group ID: 00000001 ... If you are comfortable with Java tools for XML you might look into ...
    (comp.lang.java.help)
  • Re: Suggestions for extracting masked selections and generating XML
    ... Then it would be quite simple to extract the data, without even needing to know much about the layout. ... Alternatively, you could take the documents to a document scanning company with the software to create masks to recognise the data fields. ... In each of the format files, the data is in a different ... make a selection and somehow "tag" it as if to say "this area ...
    (microsoft.public.office.misc)