>i was trying to do something like this
>Get a list of subdirectiories
> Say my base directory is /ci ..and it has folders like
>/ci/RL_1_5_9 , /ci/RL_1_5_10 , /ci/RL_1_5_11
> and inturn under folder RL_1_5_9 i have 2007_15030945
> basically i have to go through status.txt present in these
directories.
>/ci/RL_1_5_9/2007_15030945, /ci/RL_1_5_9/2007_15031000
>and if the status.txt has a string "FAIL" then I have to delete
>2007_15030945,2007_15031000 directories.
>Is there a cleaner way to do this in ANT or should I rely on
>the not so nice
>way of having java scripts in my build.xml
Just an idea:
implement your own fileselector (this wont be a "real" selector, we've
using only the selector framework here ;)
<fileset dir="ci" includes="**/status.txt">
<scriptselector language="javascript">
// see manual of <scriptcondition> about predefined
// variables like "filename" and "file"
// for security reasons, ignore all other files
if (!"status.txt".equals(filename)) return true;
// read the content and see if it failed
content = org.apache.tools.ant.util.FileUtils.getFileUtils()
.readFully( new java.io.FileReader(filename) );
statusHasFailed = content.contains("FAILED");
// then delete the directory
dir = file.getParent();
</scriptselector>
</fileset>
Maybe that helps. But because of deletion, try it in a small base
directory! ;-)
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]