You could use the <size> selector.
http://ant.apache.org/manual/CoreTypes/selectors.html#sizeselect 

1. Unzip all "large" files to "upload" directory
2. copy all "small" files to "upload"
3. upload all files in "upload"

<property name="unzip.threshold.size" value="5"/>
<property name="unzip.threshold.unit" value="k"/>
<unzip dest="${dist.dir}">
    <fileset dir="${build.dir}" includes="**/*.zip,**/*.cod">
        <size id="threshold.selector" value="${unzip.threshold}" 
units="${unzip.threshold.unit}" when="more"/>
    </fileset>
</unzip>
<copy todir="${dist.dir}">
    <fileset dir="${build.dir}" includes="**/*.zip,**/*.cod">
        <not><size refid="threshold.selector"/></not>
    </fileset>
</unzip>
<ftp ... />



Jan

>-----Ursprüngliche Nachricht-----
>Von: Patrick Waugh [mailto:[EMAIL PROTECTED] 
>Gesendet: Samstag, 15. November 2008 12:54
>An: Ant Users List
>Betreff: any way to do this with Ant?
>
>Well, I have everything finally working with my Ant build, but one
>final deployment part.
>
>What I need to do is this:
>
>       <!-- DEPLOY TARGET -->
>       <target name="deploy" description="Deploy to server via ftp">
>               <!-- Gather files to deploy -->
>               <unzip src="${build.dir}/${cod.name}.cod" 
>dest="${dist.dir}"/>
>               <copyfile dest="${dist.dir}" 
>src="${build.dir}/${cod.name}.jad"/>
>
>               <ftp server="berrysoft.net" userid="berrysof" 
>password="1emorthen1"
>remotedir="public_html/downloads" action="send">
>                       <fileset dir="${dist.dir}" casesensitive="yes">
>                               <include name="**/*.cod" />
>                               <include name="${cod.name}.jad" />
>                       </fileset>
>               </ftp>
>       </target>
>
>but there is one problem.  In some cases, the .cod file create by javc
>(bb-ant-tools) does not need to be unzipped.  (See when a .cod is
>larger than a certain defined threshold, it gets broken into multiple
>cods then zipped up, but for OTA deployment, any such cod must be
>unzipped for deployment).
>
>So, in short, I need to be able to either move the file as is, or if I
>determine it can be unzipped, unzip it to the dist.dir.
>
>Problem is, I have no idea how I can determine if it needs to 
>be unzipped!
>
>Ideas?
>
>Patrick
>
>---------------------------------------------------------------------
>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