ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kiarna Boyd" <kia...@hotmail.com>
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 
path.

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

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

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

</target>

4
<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" />

</target>






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!

Kiarna



_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


Mime
View raw message