ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: any way to do this with Ant?
Date Mon, 17 Nov 2008 07:28:43 GMT
You could use the <size> selector. 

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}"
<copy todir="${dist.dir}">
    <fileset dir="${build.dir}" includes="**/*.zip,**/*.cod">
        <not><size refid="threshold.selector"/></not>
<ftp ... />


>-----Urspr√ľngliche Nachricht-----
>Von: Patrick Waugh [] 
>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" 
>		<copyfile dest="${dist.dir}" 
>		<ftp server="" userid="berrysof" 
>remotedir="public_html/downloads" action="send">
>			<fileset dir="${dist.dir}" casesensitive="yes">
>				<include name="**/*.cod" />
>				<include 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!
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message