如何使用 NAnt 的内部命令 (Command.com)? (“类型”等)
在 Windows 系统上,某些 dos 命令没有可以通过 NAnt 的 exec 任务显式调用的可执行文件。 (我专门讨论 Command.com 中的命令)
可以找到完整的列表 这里。虽然一些更有用的命令可以通过 NAnt 或 NAntContrib 任务(复制、移动、重命名等)来实现,但有些命令(例如“类型”)则不能。
如何在构建过程中执行这些命令?例如,使用通配符,如何轻松地显示我的构建执行的外部命令中的日志文件的内容(以便外部命令的日志文件内容将回显到构建的日志文件中)
On windows systems, certain dos commands don't have executables that can be explicitly called via NAnt's exec task. (I'm talking specifically about commands that are part of Command.com)
A complete list can be found here. While some of the more useful commands can be achieved with NAnt or NAntContrib tasks (copy, move, rename etc), some (such as 'type') cannot.
How can you execute these commands as part of a build? For example, using a wildcard, how can I easliy display the contents of a log file from an external command executed by my build (so that the external command's log file contents will become echoed into the build's log file)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以通过以下方式使用 exec 任务调用内部命令:
对于问题中的场景(其中日志的文件名基于当前时间,在构建过程中),而不是解析/扫描文件名,而是将其加载到一个属性,然后回显它,您可以通过以下任务回显日志内容:
Internal commands can be called using the exec task in the following manner :
For the scenario in the question (where the log's filename is based on the current time, partway through the build), rather than parsing/scanning for the filename, loading it into a property and then echoing it, you could echo log contents with the following task :