Echo linebreak在Windows上使用Phing文件 [英] Echo linebreak to file using Phing on Windows
问题描述
< echo file =$ {build.dir} \build.txt > DATE = $ {DATE} \r\\\
\\\\\\\\\ PHP_EOL< / echo>
是否有其他人设法通过Phing获得换行?我已经看了phing中的代码,它使用fwrite。我只能猜测我的build.xml中的字符串正在以某种方式越过被fwrite处理之前?\\ b
$ b我想我可能不得不诉诸使用ExecTask?
您可以使用 $ {line.separator}
请参阅内置属性 文档 。
< echo msg =DATE:$ {DATE} $ {line。 SVN修订版:$ {svn.lastrevision} $ {line.separator}file =$ {build.dir} \build.txtappend =true/>
In my build script I'm trying to output the date and SVN revision number to a file in the build directory. I would like the date and revision number on separate line, but can't get a linebreak to output to the file. I've tried all sorts 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 managed to get a linebreak through to file with Phing? I've looked at the code in phing, and it uses fwrite. I can only guess the strings in my build.xml are getting escaped in some way before being handled by fwrite?
I guess I may have to resort to using ExecTask?
You can make use of ${line.separator}
, see Built-In PropertiesDocs.
<echo msg="DATE: ${DATE}${line.separator}SVN revision: ${svn.lastrevision}${line.separator}" file="${build.dir}\build.txt" append="true" />
这篇关于Echo linebreak在Windows上使用Phing文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!