ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: Did 1.6 break old filter behaviour?
Date Wed, 07 Jan 2004 10:30:58 GMT
I have found the cause of the error.
This will be fixed in ant 1.6.1.

Peter
Colin Sampaleanu wrote:

> That solution doesn't work too well, since I was relying on global 
> filters for copying in several places, and don't want to redefine them 
> each time. However, I was also already using
>      <filterchain>
>        <expandproperties/>
>      </filterchain>
> in the copy tasks, so until this is fixed I am doing something like 
> this to define the filter/prop to replace:
>    <!-- broken, use property instead -->
>    <!--filter token="EMAIL_FROM" value="${email.from}" /-->
>    <property name="EMAIL_FROM" value="${email.from}" />
>
> and in my source file I have replaced all @EMAIL_FROM@ occurences to 
> ${EMAIL_FROM}
>
> Regards,
> Colin
>
>
> Peter Reilly wrote:
>
>> Until it gets fixed, you could use a filterchain with replacestring 
>> instead:
>>
>>  <target name="chain">
>>    <delete quiet="yes" file="filter.out"/>
>>    <copy file="filter.inp" tofile="filter.out">
>>      <filterchain>
>>        <replacestring from="@EMAIL_FROM@" to="admin-dev@something.com"/>
>>      </filterchain>
>>    </copy>
>>  </target>
>>
>> Peter
>>
>> Colin Sampaleanu wrote:
>>
>>> Bummer, this is pretty nasty...
>>>
>>> Peter Reilly wrote:
>>>
>>>> This looks like the same problem as
>>>>
>>>> http://issues.apache.org/bugzilla/show_bug.cgi?id=23154
>>>> which we have not been able to reproduce.
>>>>
>>>> With an input file: filter.inp
>>>> @EMAIL_FROM@ token
>>>> @EMAIL_FROM@ token
>>>>
>>>> and a build file:
>>>>
>>>> <project>
>>>>  <property name="email.from" value="admin-dev@something.com"/>
>>>>  <filter token="EMAIL_FROM" value="${email.from}" />
>>>>  <delete quiet="yes" file="filter.out"/>
>>>>  <copy file="filter.inp" tofile="filter.out" filtering="yes"/>
>>>> </project>
>>>>
>>>> the problem can be reproduced.
>>>>
>>>> Peter
>>>>
>>>> Colin Sampaleanu wrote:
>>>>
>>>>> I have a filter set as follows:
>>>>>
>>>>> <property name="email.from" value="admin-dev@something.com"/>
>>>>> ...
>>>>> <filter token="EMAIL_FROM" value="${email.from}" />
>>>>>
>>>>> this worked fine in ant 1.5, for replacing this filter value in a 
>>>>> file with multiple @EMAIL_FROM@ tokens in it, via a copy task with 
>>>>> filter="on"
>>>>>
>>>>> With ant 1.6, I now get this behaviour:
>>>>>     [copy] Copying 1 file to 
>>>>> D:\src\something\cvs\core\core-services\target\classes
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
>>>>>     [copy] Inifinite loop in tokens. Currently known tokens : 
>>>>> [EMAIL_FROM]
>>>>>     [copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>>     [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>>     ... and so on
>>>>>
>>>>> Now obviously the @ sign in the email address is confusing the 
>>>>> token processor, and it works fine if I replace it with another 
>>>>> value, but this worked fine in ant 1.5!
>>>>>
>>>>> Can anybody confirm if this is a bug?
>>>>
>>>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message