ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Reason" <matt.rea...@movielink.com>
Subject echo "something" >> somefile
Date Thu, 04 Mar 2004 22:23:41 GMT
 
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>
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message