regexp mapper difficulties
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Todd_Chambery
Posted On:   Wednesday, October 31, 2001 06:42 AM

Hi, I'm working with a set of ejb descriptors that don't follow the naming convention ant expects. All the descriptors are named: ejb-jar.xml weblogic-ejb-jar.xml By prepending the name of the ejb to the descriptor I was able (finally!) to get the weblogic part of the .. descriptors foo_bar_Access meta-inf ejb-jar.xml weblogic-ejb-jar.xml I want to copy it into a structure like this: .. ant_descriptors foo_bar_Access meta-inf foo_bar_Access-ejb-jar.xml foo_bar_Access-weblogic-ejb-jar.xml I thought this was exactly what the mapper example from the Map   More>>

Hi,

I'm working with a set of ejb descriptors that don't follow the naming convention ant expects. All the descriptors are named:


			ejb-jar.xml
			
weblogic-ejb-jar.xml

By prepending the name of the ejb to the descriptor I was able (finally!) to get the weblogic part of the

			
..
descriptors
foo_bar_Access
meta-inf
ejb-jar.xml
weblogic-ejb-jar.xml

I want to copy it into a structure like this:
			
..
ant_descriptors
foo_bar_Access
meta-inf
foo_bar_Access-ejb-jar.xml
foo_bar_Access-weblogic-ejb-jar.xml

I thought this was exactly what the mapper example from the Mapping File Names page did, namely:
			


but the (-verbose) output from ant tells a different story:
			
...
[copy] foo_bar_Accessmeta-infejb-jar.xml skipped - don't know how to handle it
...
[copy] foo_bar_Access skipped - don't know how to handle it
[copy] foo_bar_Accessmeta-inf skipped - don't know how to handle it

Here's the target that's doing the work:
			






from ="^(.*)/([^/]+)/([^/]*)$$"
to ="1/2/2-3"/>




Any help is greatly appreciated.    <<Less

Re: regexp mapper difficulties

Posted By:   Todd_Chambery  
Posted On:   Wednesday, October 31, 2001 07:31 AM

Ok, so I'm a doofus. It says right in the Mapping File Names:

"Note that Ant will not automatically convert / or characters in the to and from attributes to the correct directory separator of your current platform. If you need to specify this separator, use ${file.separator} instead."

changing the "/" to "\" in the mapping expression fixed it. Of course, I will define the property when I give it over to other folks. Here's the Windows file separator fixed mapper:



from ="^(.*)\([^\]+)\([^\]*)$$"
to ="1\2\1-3"/>
About | Sitemap | Contact