ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommy Nordgren <tommy.nordg...@chello.se>
Subject Re: Trying to escape quote character in cpptasks type (repost)
Date Tue, 21 Feb 2006 19:34:58 GMT

On 21 feb 2006, at 18.05, Ben Pracht wrote:

> I'm trying to pass in a macro define to the command line to define  
> the level of code being used.  Something like
>
> gcc -o objname.o source.c -DFIXLVL=\"FEB 17 2006\"
>
> the code does something like:
> static const char mszFixLvl[] = " " __FILE__ " at " FIXLVL " on "  
> __DATE__ " at " __TIME__ " ";
>
> so the value of FIXLVL must have quotes at the time preprocessing  
> begins and cannot have been stripped off by ant, cpptasks, or any  
> other thing in between.
>
> I'm using cpptasks 1.0b3, ant 1.6.5.
>
> I've tried
> <defineset><define name="FIXLVL" value="&quot;FEB 17 2006&quot;"/></

> defineset>
>
> and
>
> <compilerarg value="-D"/><compilerarg value="FIXLVL=&quot;FEB 17  
> 2006&quot;"/>
>
> I've even tried defining the fix level in a property, and then  
> using the property name in the defineset value, but it was too  
> smart for that.
>
> How can I force this thing to listen to me?
>
> Thanks,
> Ben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
	Try value="'FIXLVL=&quot;FEB 17 2006&quot;'"

That is - put single quotes immediately inside the outer double  
quotes, to prevent the inner quotes from being stripped off by the  
shell.

"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"


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


Mime
View raw message