At the end of a NAnt script, the last step is to create a ZIP file.
Currently, I'm doing this:
<zip zipfile="${target.dropfile}">
<fileset basedir="${somefolder}">
<include name="file1.dll" />
</fileset>
<fileset basedir="${someotherfolder}">
<include name="file2.dll" />
</fileset>
<!-- ...etc ... -->
</zip>
This works fine, but I want the zip file to be a little more organized. I want the zip file to contain two folders, folder1 and folder2, and I want file1.dll to be in folder1 and file2.dll to be in folder2. Is there any way of doing this within the <zip />
task?
Just use the prefix variable.
<zip zipfile="${target.dropfile}">
<fileset basedir="${somefolder}" prefix="folder1">
<include name="file1.dll" />
</fileset>
<fileset basedir="${someotherfolder}" prefix="folder2">
<include name="file2.dll" />
</fileset>
<!-- ...etc ... -->
</zip>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With