title: Ant Won't Create NL when echoing to a file
body: <p>I originally had this:</p>
  <pre><code>&lt;echo file=&quot;${my.file}&quot;
       message=&quot;This is line #1&quot;/&gt;
  &lt;echo file=&quot;${my.file}&quot;
       append=&quot;true&quot;
       message=&quot;This is line #2&quot;/&gt;
  &lt;echo file=&quot;${my.file}&quot;
       append=&quot;true&quot;
       message=&quot;This is line #3&quot;/&gt;
  </code></pre>
  <p>And got this in my file:</p>
  <pre><code> This is line#1This is line #2This is line#3
  </code></pre>
  <p>So, I tried:</p>
  <pre><code> &lt;echo file=&quot;${my.file}&quot;&gt;
       This is line #1
       This is line #2
       This is line #3
   &lt;/echo&gt;
  </code></pre>
  <p>And got:</p>
  <pre><code> This is line#1This is line #2This is line#3
  </code></pre>
  <p>I did this:</p>
  <pre><code> &lt;echo file=&quot;${my.file}&quot;&gt;
       This is line #1${line.separator}
       This is line #2${line.separator}
       This is line #3${line.separator}
   &lt;/echo&gt;
  </code></pre>
  <p>And got:</p>
  <pre><code> This is line#1This is line #2This is line#3
  </code></pre>
  <p>I did this:</p>
  <pre><code>  &lt;echo file=&quot;${my.file}&quot;&gt;
       This is line #1&amp;#13;&amp;#10;
       This is line #2&amp;#13;&amp;#10;
       This is line #3&amp;#13;&amp;#10;
   &lt;/echo&gt;
  </code></pre>
  <p>And got:</p>
  <pre><code> This is line#1This is line #2This is line#3
  </code></pre>
  <p>I even tried this:</p>
  <pre><code> &lt;concat destfile=&quot;${my.file}&quot;&gt;
       This is line #1&amp;#13;&amp;#10;
       This is line #2&amp;#13;&amp;#10;
       This is line #3&amp;#13;&amp;#10;
   &lt;/concat&gt;
  </code></pre>
  <p>And still got:</p>
  <pre><code> This is line#1This is line #2This is line#3
  </code></pre>
  <p>If I do any of these to the console, it prints on separate lines. Saving them to a file, and the lines don't show up.</p>
  <p>I'm on Win7, Ant 1.8 something.</p>
  <p>Any ideas?</p>
  <hr />
  <h2>Windows Thing?</h2>
  <p>I've tried each of these on my Mac. The first one gave me the same results. However, the second way gave me three lines in the file. The third way with the <code>${line.separator}</code> added skipped every other line. The fourth way using <code>&amp;#13;&amp;10;</code> gave me every other line with a <code>^M</code> at the end (after all, the Mac is Unix and doesn't use the CRLF ending, but just LF).</p>
  <p>And, using <code>&lt;concat&gt;</code> also created separate lines.</p>
  <hr />
  <h2>More information</h2>
  <p>I've traced down the issue to the following snippet from my <code>build.xml</code> file:</p>
  <p>This works as advertised. That is, white space and <code>NL</code> show up in the resulting file:</p>
  <pre><code>&lt;target name=&quot;package&quot;
      depends=&quot;-resolve,compile&quot;
      description=&quot;Packaging of the artifact&quot;&gt;
  
      &lt;!-- Build version.txt and let the user figure out how to use it --&gt;
      &lt;mkdir dir=&quot;${target.dir}&quot;/&gt;
      &lt;echo file=&quot;${version.file}&quot;&gt;
          Jenkins Project: ${env.JOB_NAME}
          Jenkins Build Number: ${env.BUILD_NUMBER}
          Build Date: ${build.date}
      &lt;/echo&gt;
  
      &lt;!--
      &lt;antcall target=&quot;jar&quot;/&gt;
      &lt;antcall target=&quot;war&quot;/&gt;
      &lt;antcall target=&quot;ear&quot;/&gt;
      --&gt;
  &lt;/target&gt;
  </code></pre>
  <p>This doesn't:</p>
  <pre><code>&lt;target name=&quot;package&quot;
      depends=&quot;-resolve,compile&quot;
      description=&quot;Packaging of the artifact&quot;&gt;
  
      &lt;!-- Build version.txt and let the user figure out how to use it --&gt;
      &lt;mkdir dir=&quot;${target.dir}&quot;/&gt;
      &lt;echo file=&quot;${version.file}&quot;&gt;
          Jenkins Project: ${env.JOB_NAME}
          Jenkins Build Number: ${env.BUILD_NUMBER}
          Build Date: ${build.date}
      &lt;/echo&gt;
  
      &lt;antcall target=&quot;jar&quot;/&gt;
      &lt;antcall target=&quot;war&quot;/&gt;
      &lt;antcall target=&quot;ear&quot;/&gt;
  &lt;/target&gt;
  </code></pre>
  <p>The only difference between these snippets in the fact that I do three <code>&lt;antcall&gt;</code> tasks AFTER I write the file. The three antcall tasks all have an <code>if</code> clause, so they may or may not run based upon the properties that are set. This is a build template for our development teams, so I really would like to get this to work.</p>
  <p>Why could the <code>&lt;antcall&gt;</code>'s be causing problems. By the way, sometimes it is so broken, I need to reopen a new console window in order to get the <code>NL</code> stuff to work.</p>
  <p>I've ran into  a similar issue before, and it was a Windows codepage issue.</p>