ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Using 'exec' task with special characters in argument line.
Date Tue, 05 Dec 2006 22:32:55 GMT
XML is sensitive to quotes and ampersands. Try putting the arg line in a
properties file, and using the property in your build.xml. This will
save you the trouble of translating the quotes and ampersands into xml
friendly entities.

-Rob A

> -----Original Message-----
> From: Chon, Ae H [mailto:AE.H.CHON@saic.com] 
> Sent: Tuesday, December 05, 2006 11:58 AM
> To: user@ant.apache.org
> Subject: Using 'exec' task with special characters in argument line.
> 
> Need help!
> 
> I'm having problems  getting trying to run a command in 
> windows using ant "exec" task:
> 
> In windows, I would would the following command:  cleartool find .
> -version "created_since(yesterday)&&!(created_since(now))" -print
> 
> I tried to simulate this using 'exec' task...but it doesn't 
> take special characters like amperstand or double quotes.
> 
> How do i get around this?  I tried to used CDATA but i get 
> the following message (see code below):  Class 
> org.apache.tools.ant.types.Commandline$Argument doesn't 
> support the nested "line" element
> 
> Which i understand...but how do i get around this?
> 
> <exec executable="cmd" os="${os.name}" failonerror="false"
> dir="${basedir}\..\..\..\..\Source" >
> <arg>
> <line><![CDATA[/c cleartool find . -version 
> "created_since(yesterday)&&!(created_since(now))" 
> -print]]></line> </arg> </exec>
> 
> thanks in advance,
> 
> Ae Hwa Chon
> Configuration Manager
>  
> 


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


Mime
View raw message