I'm using very similar scheme (not zip, but ndoc - but exactly same problem)
 
   <fileset id="docassemblies"/>
     
   <foreach item="File" property="filename">
    <in>
     <items basedir="${xmldocbuild.dir}">
      <include name="*.xml"/>
     </items>
    </in>
    <do>
     <property name="filename" value="${path::get-file-name-without-extension(filename)}"/>
     <echo message="Building documentation for ${filename}"/>
     <if test="${file::exists(xmldocbuild.dir+'\'+filename+'.dll')}">
      <fileset id="docassemblies" basedir="${xmldocbuild.dir}">
       <includesfileset refid="docassemblies"/>
       <include name="${filename}.dll"/>
      </fileset>
     </if>
    </do>
   </foreach>
   <ndoc failonerror="true">
    <assemblies refid="docassemblies"/>
   </ndoc>
As you can see, I'm using fileset merging mechanism, which unfortunatelly is not supported in current NAnt source. But you could take patch I sent to list. I hope, admins will incorporate that into sources one day.
 
Martin
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shelly Midha
Sent: Tuesday, May 10, 2005 1:28 PM
To: nant-developers@lists.sourceforge.net
Subject: [nant-dev] including files in a zipfile using <zip> task

 

 

I want to include files in an existing zip file using <zip> task, based on a specific criterion.

 

If I include the condition with in the <zip> task, it is not supported. I’ve written a separate target that includes files in the zip.

 

Every time this target is called, it overwrites the zip file and creates new one.

 

Here is the code for the two targets I’m using:

 

<target name="include-db-full">

            <foreach item="File" property="filename">

                        <in>

                              <items>

                                    <include name="${build.path}\**\*.sql"/>

                              </items>

                        </in>

                        <do>

                              <if test = "${string::contains(filename, 'full')== true}" >

                                    <echo message = "${filename}"/>

                                    <call target="include-sql-in-package"/>

                              </if>

                        </do>

            </foreach>

      </target>

     

      <target name="include-sql-in-package">

            <zip zipfile="${build.zipfile}" ziplevel="9">  

                  <fileset basedir="${build.path}">

                        <include name="${filename}"/>

                  </fileset>

            </zip>

      </target>

 

Any pointers to resolve the same will be helpful.

 

Thanks

Shelly

 

Reply via email to