ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyril Sagan <>
Subject <manifest>: add arbitrary set of properties?
Date Thu, 26 Jan 2006 21:36:24 GMT

In our current java build process, we'd like to be able to allow users
to add arbitrary items to the jar manifest.

But, 1) we won't know the attribute names, and 2) some builds will
have these "extra" manifest, some won't.

In the ideal solution, the build.xml would look something like this:
    <jar ... >
            <attribute name="Specification-Vendor" value="ABC Vendor" />
            <attribute name="Implementation-Vendor" value="ABC Vendor" />
            <attribute name="Implementation-Vendor-Id" value=""/>
            <!-- for each property named manifest.* add here -->

... and the user would be able to invoke ant like this:
    $ ant -Dmanifest.Foo=bar -Dmanifest.Color=green

The build.xml should find every property with the "manifest." prefix,
then add to the manifest.  The resulting manifest would then look like
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.)
    Specification-Vendor: ABC Vendor
    Implementation-Vendor: ABC Vendor
    Foo: Bar
    Color: Green

The only thing I can think of is to use a property set like this:
    <propertyset id="manifest-properties">
        <propertyref prefix="manifest.">

... and extend to take a propertyref id.

Does anyone have any better ideas/suggestions??  Thanks.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message