如何通过ant执行JavaScript文件并将stdout和stderr重定向到文件?
例如,假设我们有
Hello World .js
console.log('Hello world!');
我需要 Ant 目标来自豪
标准输出.txt
Hello world!
可以创建包含所需 JavaScript 文件的临时 HTML 文件,然后执行 tmp.html,但如果可能,我想省略此步骤。
最佳答案
您可以使用 Rhino从 ant 执行 Javascript。参见 this question或任何 these questions例如。
关于javascript - 通过 ant 执行 JavaScript (HTML) 文件并将输出重定向到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7761026/