ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31375] - regexp type mapper doesn't work without the '^' character.
Date Thu, 23 Sep 2004 15:39:48 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31375>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31375

regexp type mapper doesn't work without the '^' character.

joel.regen@activant.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From joel.regen@activant.com  2004-09-23 15:39 -------
Ok. this is a bit embarrassing...what I discovered is that, after much trial 
and error, the use of a mapper element within a propertyset is quite adversely 
affected by the lack of a preceding <propertyref> element of appropriate 
constraint. So, when I finally stopped 'trying things' to make the propertyset 
work (within an echoproperties element later), my conclusion was clouded by 
having 'tried' the inclusion of a ^ in the mapper's regex expression combined 
(most likely overlooked) with the inclusion of the preceding propertyref 
element.

Here's the shorter, simpler test case:
<?xml version="1.0" encoding="UTF-8"?>
<project default="dist" name="test" basedir=".">
    <property name="filter.local.foo"   value="1234"/> 
    <property name="filter.dev.foo"     value="4321"/> 
    <property name="filter.generic.foo" value="bar"/>  
    <property name="filterset"          value="local"/>         
    
    <target name="dist">                               
        <propertyset id="specific.filters">            
            <propertyref regex="filter\.${filterset}\..*"/>
            <mapper type="regexp"                      
                from="filter\.${filterset}\.(.*)" 
                to="filter.\1"/>                   
        </propertyset> 
        <echoproperties>
    	    <propertyset refid="specific.filters"/>
	    </echoproperties>
    </target>                                          
</project> 

This produces:
[echoproperties] filter.foo=1234

And, removing the <propertyref ...> from the propertyset (preceding the mapper 
sub-element) produces no output:

Long story - short: I made a faulty assessment about the mapper functionality 
based on working too many hours and being too tired to sort out my 
experimental data.  The conclusion is that THIS IS NOT A BUG. 

That said, I would recommend that, in the documentation on propertyset in the 
section on using a mapper element, it be explicitly stated what the 
relationship and interaction is between the mapper element and the preceding 
propertyref element.  Most importantly, that a mapper element won't work 
without that propertyref element.  This is not clear.

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


Mime
View raw message