ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: Mapper: renaming + flattening
Date Thu, 08 Jul 2004 14:08:50 GMT
Ah, you are using a version of dos.

In dos and windows, directories use '\', so the regex or glob needs to
modified to do that.

Peter

Patrick Martin wrote:

>I get the same problem with ant 1.6.1 and ant 1.6.2beta1.
>
>  
>
>> -----Original Message-----
>>From: 	Patrick Martin <patrick.martin@sungard.com>@SUNGARD  
>>Sent:	jeudi 8 juillet 2004 15:47
>>To:	'Ant Users List'
>>Subject:	RE: Mapper: renaming + flattening
>>
>>
>>It might be because I am using ant 1.5.3 then because I get this output:
>>[mkdir] Created dir: D:\DVLP\Dir-a\subdir
>>[mkdir] Created dir: D:\DVLP\Dir-b\subdir
>>[mkdir] Created dir: D:\DVLP\Dir-c\subdir
>>[touch] Creating D:\DVLP\Dir-a\subdir\file.template
>>[touch] Creating D:\DVLP\Dir-b\subdir\file.template
>>[touch] Creating D:\DVLP\Dir-c\subdir\file.template
>>[mkdir] Created dir: D:\DVLP\dest
>>fileset: Setup scanner in dir D:\DVLP with patternSet{ includes:
>>[Dir-*/subdir/file.template] excludes: [] }
>>	[copy] Dir-a\subdir\file.template skipped - don't know how to handle
>>it
>>	[copy] Dir-b\subdir\file.template skipped - don't know how to handle
>>it
>>	[copy] Dir-c\subdir\file.template skipped - don't know how to handle
>>it
>>
>>    
>>
>>> -----Original Message-----
>>>From: 	Peter Reilly <peter.reilly@corvil.com>@SUNGARD
>>>Sent:	jeudi 8 juillet 2004 15:30
>>>To:	Ant Users List
>>>Subject:	Re: Mapper: renaming + flattening
>>>
>>>Your example works fine for me.
>>><target name="c">
>>>	<mkdir dir="Dir-a/subdir"/>
>>>	<mkdir dir="Dir-b/subdir"/>
>>>	<mkdir dir="Dir-c/subdir"/>
>>>	<touch file="Dir-a/subdir/file.template"/>
>>>	<touch file="Dir-b/subdir/file.template"/>
>>>	<touch file="Dir-c/subdir/file.template"/>
>>>	<mkdir dir="dest"/>
>>>	<copy todir="dest">
>>>		<fileset dir="." includes="Dir-*/subdir/file.template"/>
>>>		<mapper type="regexp"
>>>from="Dir-(.*)/subdir/file\.template$$"
>>>	to="\1.file"/>
>>>	</copy>
>>></target>
>>>
>>>outputs:
>>>c:
>>>Created dir: /home/preilly/learning/a/copy/Dir-a/subdir
>>>Created dir: /home/preilly/learning/a/copy/Dir-b/subdir
>>>Created dir: /home/preilly/learning/a/copy/Dir-c/subdir
>>>Creating /home/preilly/learning/a/copy/Dir-a/subdir/file.template
>>>Creating /home/preilly/learning/a/copy/Dir-b/subdir/file.template
>>>Creating /home/preilly/learning/a/copy/Dir-c/subdir/file.template
>>>Created dir: /home/preilly/learning/a/copy/dest
>>>Copying 3 files to /home/preilly/learning/a/copy/dest
>>>
>>>Peter
>>>
>>>Patrick Martin wrote:
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>I want to copy files somewhere renaming them after their path.
>>>>
>>>>For example, I have the following tree:
>>>>Dir-a/subdir/file.template
>>>>Dir-b/subdir/file.template
>>>>Dir-c/subdir/file.template
>>>>
>>>>And I want to copy those 3 files as
>>>>a.file
>>>>b.file
>>>>c.file
>>>>
>>>>Here is what I tried:
>>>><copy todir="dest">
>>>> <fileset dir="." includes="Dir-*/subdir/file.template"/>
>>>> <mapper type="regexp" from="Dir-(.*)/subdir/file\.template$$"
>>>>to="\1.file"/>
>>>></copy>
>>>>
>>>>But nothing gets copied and there is no error output. With -debug, it
>>>>        
>>>>
>>>seems
>>>      
>>>
>>>>that the copy task does not find any file...
>>>>
>>>>I also tried the following mapper, with the same result:
>>>> <mapper type="glob" from="Dir-*/subdir/file.template" to="*.file"/>
>>>>
>>>>Thank you,
>>>>
>>>>Patrick
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>Confidentiality Notice: The information contained in this e-mail
>>>>        
>>>>
>>message
>>    
>>
>>>is
>>>      
>>>
>>>>intended only for the personal and confidential use of the recipient(s)
>>>>named above. If the reader of this message is not the intended
>>>>        
>>>>
>>recipient
>>    
>>
>>>or
>>>      
>>>
>>>>an agent responsible for delivering it to the intended recipient, you
>>>>        
>>>>
>>are
>>    
>>
>>>>hereby notified that you have received this document in error and that
>>>>        
>>>>
>>>any
>>>      
>>>
>>>>review, dissemination, distribution, or copying of this message is
>>>>        
>>>>
>>>strictly
>>>      
>>>
>>>>prohibited. If you have received this communication in error, please
>>>>        
>>>>
>>>notify
>>>      
>>>
>>>>us immediately by e-mail, and delete the original message.
>>>>
>>>>Message confidentiel : Les informations contenues dans ce message sont
>>>>destinees a un usage personnel et confidentiel du destinataire indique
>>>>ci-dessus. Si le lecteur de ce message n'est pas le destinataire prevu,
>>>>        
>>>>
>>>ou
>>>      
>>>
>>>>n'est pas une personne en charge de le delivrer au destinataire voulu,
>>>>        
>>>>
>>>vous
>>>      
>>>
>>>>etes par la presente informe que vous avez recu ce document par erreur,
>>>>        
>>>>
>>>et
>>>      
>>>
>>>>que tout examen, transmission, distribution ou copie de ce message est
>>>>totalement interdit. Si vous avez recu cette communication par erreur,
>>>>        
>>>>
>>>nous
>>>      
>>>
>>>>vous remercions de bien vouloir nous avertir immediatement par e-mail
>>>>        
>>>>
>>et
>>    
>>
>>>de
>>>      
>>>
>>>>detruire le message d'origine.
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>>
>>>
>>>
>>>
>>>      
>>>
>>Confidentiality Notice: The information contained in this e-mail message
>>is
>>intended only for the personal and confidential use of the recipient(s)
>>named above. If the reader of this message is not the intended recipient
>>or
>>an agent responsible for delivering it to the intended recipient, you are
>>hereby notified that you have received this document in error and that any
>>review, dissemination, distribution, or copying of this message is
>>strictly
>>prohibited. If you have received this communication in error, please
>>notify
>>us immediately by e-mail, and delete the original message.
>>
>>Message confidentiel : Les informations contenues dans ce message sont
>>destinees a un usage personnel et confidentiel du destinataire indique
>>ci-dessus. Si le lecteur de ce message n'est pas le destinataire prevu, ou
>>n'est pas une personne en charge de le delivrer au destinataire voulu,
>>vous
>>etes par la presente informe que vous avez recu ce document par erreur, et
>>que tout examen, transmission, distribution ou copie de ce message est
>>totalement interdit. Si vous avez recu cette communication par erreur,
>>nous
>>vous remercions de bien vouloir nous avertir immediatement par e-mail et
>>de
>>detruire le message d'origine.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>>
>>    
>>
>Confidentiality Notice: The information contained in this e-mail message is
>intended only for the personal and confidential use of the recipient(s)
>named above. If the reader of this message is not the intended recipient or
>an agent responsible for delivering it to the intended recipient, you are
>hereby notified that you have received this document in error and that any
>review, dissemination, distribution, or copying of this message is strictly
>prohibited. If you have received this communication in error, please notify
>us immediately by e-mail, and delete the original message. 
>
>Message confidentiel : Les informations contenues dans ce message sont
>destinees a un usage personnel et confidentiel du destinataire indique
>ci-dessus. Si le lecteur de ce message n'est pas le destinataire prevu, ou
>n'est pas une personne en charge de le delivrer au destinataire voulu, vous
>etes par la presente informe que vous avez recu ce document par erreur, et
>que tout examen, transmission, distribution ou copie de ce message est
>totalement interdit. Si vous avez recu cette communication par erreur, nous
>vous remercions de bien vouloir nous avertir immediatement par e-mail et de
>detruire le message d'origine.
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>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


Mime
View raw message