Ew - thats a really nice solution :) Now to remove my foot from my
mouth ;)
On Wed, 22 Jul 2009, David Weintraub wrote:
Ah! You want to see if the "replace" failed!
Try this:
*<resoucecount property="files.not.replaced">*
* <fileset dir="${property.dir}">*
* <containsregexp expression="@[...@][^@]*@"/>*
* <fileset>*
*</resourcecount>*
*
<echo>Files failing replace: ${files.not.replaced}</echo>
<fail message="Some value didn't get replaced by replacement macro!">
<condition>
<not>
<equal arg1="${files.not.replaced}" arg2="0"/>
</not>
<condition>
</fail>
*
Let's take this apart:
The *<fileset dir="${property.dir}">* should be the directory that contains
the files with the variables being replaced. You then use the *
<containregexp>* to find the files that contain the regular expression "*
@[...@][^@]...@*"
The *<resourcecount>* counts the number of files that your
*<fileset>*selects. Thus if the count is greater than zero, at least
one file has a
parameter that wasn't replaced.
2009/7/22 Júlio Cesar Bueno Cotta <juliocbco...@gmail.com>
I alread have a ant script to replace the variables..and it is working.
What I need is check if all the variables are beeing replaced.
I have a dev.properties where I have lines like this
@v...@=test
each @vari@ is replaced to "test" after I run the script.
But
If I forget to add the variable in the dev.properties , that variable wont
be replaced.
I want to search all the varibles not replaced.
Thanks.
2009/7/22 David Weintraub <qazw...@gmail.com>
You can do this with the <copy> task via the <filter>:
A good example is given on this page:
<http://ant.apache.org/manual/CoreTasks/copy.html>
Look for the text "*Copy a set of files to a directory, replacing
@ti...@with Foo Bar in all files."
*You can also look here: http://ant.apache.org/manual/index.html at the
<filter> task.
And, take a look over here too:
<http://ant.apache.org/manual/CoreTypes/filterset.html>
This one shows the concept of a "filterset" and how it works with the
<copy>
task. It also has some excellent examples.
2009/7/22 Júlio Cesar Bueno Cotta <juliocbco...@gmail.com>
Hello there,
I am new over here and I need some help.
There is a script that replace variables in the files.
And I am trying to write a ant script to find in the replaced files (
into
a
folder like workspace/web-inf/ ) variables witch were not replaced..
Someone can help me?
Is there some task to do that?
I am sorry if I am not clear..my English is not pretty good.
Thanks all.
--
Júlio Cesar Bueno Cotta
Graduando em ciência da computação
Universidade Federal de Viçosa
--
David Weintraub
qazw...@gmail.com
--
Júlio Cesar Bueno Cotta
Graduando em ciência da computação
Universidade Federal de Viçosa
--
David Weintraub
qazw...@gmail.com
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-890-8117 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org