ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kiarna Boyd" <>
Subject RE:directory index to URL creation
Date Mon, 21 Apr 2003 19:46:37 GMT
Hi folks,

This isn't pretty and maybe others have tidier ways of doing this but I 
found a way to index my directory structure and use it for creating 
sequential URL hits to update the database jsp's.
I have 'get' ignoreerrors on because I need to buff up my conditionals for 
more than one arg.

I use a lot of exec commands making dinky scripts for non ant functionality.

1. made a script for exec to call that just does a 'ls -m' of the basedir 
the output is directed to my foreach list variable.

2. created the foreach target using the list ability and delimiter to handle 
the output of 'ls -m'

3. Conditional tag to keep it from choking on a non URL directory in the 

4. very simple use of ant's get command to tap the servlet.

<target name="updatejsp" description="to hit the web url and update each 
client" >
                <exec executable="${scripts}/list" outputproperty="list" >
       <env key="BASEDIR" value="${basedir}"/>
        <foreach target="update4jsp" param="thisEnv" list="${list}"  
inheritall="true" delimiter=", " >

<target name="update4jsp" description="conditions for jsp update" >
        <condition property="not.client.dir" >
                <equals arg1="${thisEnv}" arg2="analog"/>
        <antcall target="jsp" />


<target name="jsp" description="hits the URL servlet"  if="not.client.dir"  
        <echo>"valid client to update ${thisEnv}"</echo>
                <get ignoreerrors="true" 
src="${url2}/${thisEnv}/${upservlet}" dest="/dev/null" />


Hope this helps other people that have low level poking skills like me!
I welcome suggestions on improving the build.file if you have them, but I'm 
glad I got it to work!


Add photos to your e-mail with MSN 8. Get 2 months FREE*.

View raw message