You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Emmanouil Batsis <Em...@eurodyn.com> on 2005/06/28 10:43:17 UTC

[solved] Task allows nested mapper but not regexpmapper with handledirsep (was Re: Help with (regexp?) file mapper)

Dominique Devienne wrote:

>> i just defined a project property to use within mappers and that
>>works well.
>>    
>>
>
>Do you mind describing your solution in more details, to help those
>who search the mailing list archive?
>
>BTW, did you try \${file.separator}? 
>  
>

That wouldn't work on my linux box right? I switch between a windows 
machine at work and my linux laptop frequently, so i initially added an 
entry in my build properties:

# controls the path seperator to use in regexp mappers,
# use "/" on unixish systems and "\\\\" on wonblows (no quotes)
mapper.dir.seperator=\\\\

and used it like

<mapper type="regexp" from="(.*)${mapper.dir.seperator}(.*).xml"

However, Peter Reilly's way removes the need to maintain a property and 
allows the use of handledirsep by just nesting the mappers:

<task.that.allows.mapper.but.not.regexp.or.other>
   <mapper>
      <regexpmapper handledirsep="true" from="(.*)/(.*).xml" 
to="\1/web/\2Form.java" />
   </mapper>
</task.that.allows.mapper.but.not.regexp.or.other>

Thanks all.

Manos

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