I don't see a setting on the zip task to 'not' include folder names.
But, you could try to just use the exec tag with winzip or 7zip or such.

BOb


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Markus
Ewald
Sent: Wednesday, October 17, 2007 7:30 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Zip multiple files in different directories

Hi!

I'm using NAnt to build multitple C# projects, each project writes its 
binaries in its own bin folder. After compilation has finished, I want 
my build script to zip up all the generated binaries into one .zip 
archive as a flat collection of files.

My current solution is to copy all the binaries into a temporary folder 
and then invoking the <zip /> task on that folder. I haven't found a 
better way yet -- if I uses the <zip /> task directly, I would end up 
with the the paths to my binaries being replicated in the zip archive 
(eg. 'project/bin/x86/release/xyz.dll').

Is there a better way (at best without copying the files into a 
temporary folder)?

--

If it helps, here's the relevant section from my current build script:

    <!-- Collect all the binaries produced by the various projects -->
    <foreach
      item="Line" in="${build.platform}.projects.csv" delim=","
      property="project.directory,project.msbuildfile,project.binary"
    >
      <copy todir="${temp.directory}">
        <fileset
basedir="${project.directory}/${project.binarydirectory}">
          <include name="**/*" />
          <exclude name="*.pdb" /> <!-- Not useful for redistribution!
-->
        </fileset>
      </copy>
    </foreach>

    <!-- All project outputs collected, now zip them up -->
    <zip
 
zipfile="${artifacts.directory}\nuclex-framework-${build.number}.zip"
      ziplevel="9"
    >
      <fileset basedir="${temp.directory}">
        <include name="**/*" />
      </fileset>
    </zip>

-Markus-

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to