ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: any way to do this with Ant?
Date Mon, 17 Nov 2008 07:28:43 GMT
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:ptwaugh@gmail.com] 
>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: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message