Is this a bug, or am I missing something?  I want to create a jar file if
and only if the class files have been updated, so naturally I have a target
for creating the jar file as follows:

    <target name="dist" depends="compile">
        <echo message="*** Creating ${moduleName} jarfile."/>
        <mkdir dir="${dist}/lib"/>
        <jar destfile="${jarLocation}/${jarFile}" basedir="${build}"
includes="${rootPath}/**/*.class" index="true"/>
    </target>

This works fine, with the jar file only being created when the class files
have actually been changed.  Now, I'd like to be able to update the internal
MANIFEST.MF file whenever the jar file is created, so I modify my target as
follows:

    <target name="dist" depends="compile">
        <echo message="*** Creating ${moduleName} jarfile."/>
        <mkdir dir="${dist}/lib"/>
        <jar destfile="${jarLocation}/${jarFile}" basedir="${build}"
includes="${rootPath}/**/*.class" index="true">
            <manifest>
                <attribute name="Build-Date" value="${buildDate}"/>
            </manifest>
        </jar>
    </target>

Now, the jar file is created EVERY TIME, even though none of the class files
have changed!  It doesn't make sense; ant should not even get inside the
<jar> task unless the class files have been touched, but it seems as if the
inclusion of the <manifest> sub-element creates an internal dependency that
I cannot control.

I ask the question again: is this a bug, or am I missing something?

Dave


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to