Here is my take on your example:

        <target name="zip-1">
                <echo>updated target for zip task</echo>
                <delete dir="dist"
                        failonerror="false"/>
                <mkdir dir="dist"/>
                <zip destfile="dist/test1.zip">
                        <fileset dir="." includes="README.html" />
                        <zipfileset dir="scripts" prefix="bin" />
                        <fileset dir="." includes="docs/**, lib/**"/>
                </zip>
        </target>

1. create the zip in a directory. clean the directory first
2. the zipfileset worked nicely to provide a prefix, renaming scripts to bin
3. fileset can also be used where appropriate

Hope this helps.

On 5/26/06, Morten Wittrock <[EMAIL PROTECTED]> wrote:
Hi everybody

I'd love some input on the best practice way to accomplish the
following. In the root of my project directory, I have three
directories and a file, that I'd like to bundle in a ZIP archive:

scripts/
docs/
lib/
README.html

I'd like to create a ZIP archive with the following content:

bin/ (the 'scripts' dir renamed)
docs/
lib/
README.html

Here's my current target:

<target name="zip">
    <zip destfile="test.zip">
        <zipfileset dir="." includes="README.html" fullpath="README.html"/>
        <zipfileset dir="scripts" prefix="bin"/>
        <zipfileset dir="docs" prefix="docs"/>
        <zipfileset dir="lib" prefix="lib"/>
    </zip>
</target>

It works, but I suspect that there might be a cleaner way to achieve
the same result?

Thanks in advance for any input!

Regards,

Morten Wittrock

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



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

Reply via email to