You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by EJ Ciramella <ec...@archivas.com> on 2005/06/23 01:06:45 UTC
Condition contains question
I'm trying the following:
<loadfile property="grinder.results" srcFile="grinderpass.csv"/>
<echo message="${grinder.results}"/>
<condition property="hasfailed">
<contains string="FAIL" substring="${grinder.results}"
casesensitive="false"/>
</condition>
<fail if="hasfailed" message="${grinder.results}"/>
But even when the file only contains "FAIL" this still goes through
stating:
testscp:
[loadfile] loading /home/source/engineering/main/grinderpass.csv into
property grinder.results
[loadfile] file size = 5
Setting project property: grinder.results -> FAIL
[loadfile] loaded 5 characters
[loadfile] grinder.results := FAIL
[echo] FAIL
Condition false; not setting hasfailed
When run in debug/verbose mode. Is it looking at the string "$
{grinder.results}" or the value of this property?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Condition contains question
Posted by EJ Ciramella <ec...@archivas.com>.
Never mind, string and substring are reversed. . .
On Jun 22, 2005, at 7:06 PM, EJ Ciramella wrote:
> I'm trying the following:
>
> <loadfile property="grinder.results" srcFile="grinderpass.csv"/>
> <echo message="${grinder.results}"/>
> <condition property="hasfailed">
> <contains string="FAIL" substring="${grinder.results}"
> casesensitive="false"/>
> </condition>
> <fail if="hasfailed" message="${grinder.results}"/>
>
> But even when the file only contains "FAIL" this still goes through
> stating:
>
> testscp:
> [loadfile] loading /home/source/engineering/main/grinderpass.csv
> into property grinder.results
> [loadfile] file size = 5
> Setting project property: grinder.results -> FAIL
> [loadfile] loaded 5 characters
> [loadfile] grinder.results := FAIL
> [echo] FAIL
> Condition false; not setting hasfailed
>
> When run in debug/verbose mode. Is it looking at the string "$
> {grinder.results}" or the value of this property?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org