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: echo "something" >> somefile
Date Thu, 04 Mar 2004 22:45:00 GMT
Check out the <concat> task.

-Rob Anderson

> -----Original Message-----
> From: Matt Reason [mailto:matt.reason@movielink.com]
> Sent: Thursday, March 04, 2004 2:24 PM
> To: user@ant.apache.org
> Subject: echo "something" >> somefile
> 
> 
>  
> I am trying get ant to do the exact equivalent of:
> echo "This is a line of text in a file" >> file.txt 
> Note that I am appending to the file.
>  
> I want a text file in my build directory that has two columns:
> Build_Number and Build_Date.  Each time I do a build, I want 
> to add one
> line to that file.
>  
> Ant keeps putting the output on the same line.  A solution is to put a
> carriage return in the message itself, but that destroys my 
> formatting -
> something that I am obsessive about.   If I put the </echo> 
> in the right
> (formatted) spot, then I get all the tabs in my output file  
> (see below)
> .
>  
> Is there a way to append a single line at the end of a file?  Or do I
> need to call exec?   Why would echo in ant have been designed
> differently than echo in all other languages?
>  
> Thanks in advance,
>  
> Matt
>  
> <!-- This keeps appending to the same line. -->
> <target name="logit">
>   <echo file="log" append="true">${buildNum} ${BuildDate}.</echo>
> </target>
>  
> <!-- This works but makes my skin crawl. (and will be formated by my
> IDE)-->
> <target name="logit">
>   <echo file="log" append="true">${buildNum} ${BuildDate}.
> </echo>
> </target>
>  
> <!-- This indents each line by two spaces. -->
> <target name="logit">
>   <echo file="log" append="true">${buildNum} ${BuildDate}.
>   </echo>
> </target>
>  
> 


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


Mime
View raw message