ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "glenn opdycke-hansen" <glenn...@gmail.com>
Subject Re: The zip task and zipfileset type
Date Sat, 27 May 2006 20:57:43 GMT
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 <mwittrock@gmail.com> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message