Echo linebreak to file using Phing on Windows

In my build script, I am trying to output the date and version number of the SVN to a file in the assembly directory. I would like the date and revision number to be on a separate line, but cannot get a line to output to a file. I tried all kinds of methods:

<echo file="${build.dir}\build.txt">DATE = ${DATE} \r\n \\\r\\\n PHP_EOL</echo> <echo msg="DATE: ${DATE} \r\n \\\r\\\n PHP_EOL 0x0D0A SVN revision: ${svn.lastrevision} . PHP_EOL" file="${build.dir}\build.txt" append="true" /> 

Has anyone else been able to get a line scroll to a file with phing? I looked at the code in phing and it uses fwrite. I can only guess that the lines in my build.xml somehow slip away before being processed by fwrite?

I think I might have to resort to using ExecTask?

+9
windows file php line-breaks phing
Aug 09 '11 at 10:50
source share
1 answer

You can use ${line.separator} , see Docs Built-in Properties .

 <echo msg="DATE: ${DATE}${line.separator}SVN revision: ${svn.lastrevision}${line.separator}" file="${build.dir}\build.txt" append="true" /> 
+15
Aug 09 2018-11-11T00:
source share



All Articles