RE: read contents of a file

2005-09-28 Thread Adam Jenkins
Untested suggestions:

1. Use ants loadfile task with a regexp task to set a condition property
or
2. Extend the ant task that does the filtering to include the check and
declare your custom task.
or
3. Use the jelly util load text tag in conjunction with the regexp tag

anyone think of any more?

-Original Message-
From: Ramon Buckland [mailto:[EMAIL PROTECTED]
Sent: Thursday, 29 September 2005 2:11 AM
To: 'users@maven.apache.org'
Subject: read contents of a file


Hi,

I am trying to work out the best way to read the contents of a file.
Specifically, I an performing an iteration over **/*.jsp files
and want to only perform tasks on JSP which have jsp:root declared 
(ie a JSP XML file).

Any ideas ?

Thanks
Ramon


RE: read contents of a file

2005-09-28 Thread Ramon Buckland
good morning sir :-)

I found a way .. my fix is a work around .. so .. 
I was happy with anything :-)

   ant:fileScanner var=jspFiles
   ant:fileset dir=${maven.build.dir}/ includes=**/*.jsp/
   /ant:fileScanner

j:forEach items=${jspFiles.iterator()} var=jspFile
indexVar=counter
ant:exec executable=grep
output=${maven.build.dir}/test.data
 arg line=lt;jsp:root/
 arg line=${jspFile}/
/ant:exec
u:loadText var=jspRoot
file=${maven.build.dir}/test.data/
j:if test=${! empty(jspRoot)}
j:set var=lofty.xmlfile value=${jspFile}/
j:set var=lofty.xsldir
value=${maven.src.dir}/xsl/weblogic9-fixes/
j:set var=lofty.outfile value=${jspFile}/
attainGoal name=lofty/
/j:if
del file=${maven.build.dir}/test.data/
/j:forEach



 -Original Message-
 From: Adam Jenkins [mailto:[EMAIL PROTECTED]
 Sent: Thursday, 29 September 2005 5:04 AM
 To: 'users@maven.apache.org'
 Subject: RE: read contents of a file
 
 
 Untested suggestions:
 
 1. Use ants loadfile task with a regexp task to set a 
 condition property
 or
 2. Extend the ant task that does the filtering to include the 
 check and
 declare your custom task.
 or
 3. Use the jelly util load text tag in conjunction with the regexp tag
 
 anyone think of any more?
 
 -Original Message-
 From: Ramon Buckland [mailto:[EMAIL PROTECTED]
 Sent: Thursday, 29 September 2005 2:11 AM
 To: 'users@maven.apache.org'
 Subject: read contents of a file
 
 
 Hi,
 
 I am trying to work out the best way to read the contents of a file.
 Specifically, I an performing an iteration over **/*.jsp files
 and want to only perform tasks on JSP which have jsp:root declared 
 (ie a JSP XML file).
 
 Any ideas ?
 
 Thanks
 Ramon