如何使用 Ant 运行 Nant 任务? [英] How to run a Nant task with Ant?

查看:33
本文介绍了如何使用 Ant 运行 Nant 任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一些看起来可行的事情,但在 Google 上的搜索并没有像我需要的那样准确返回.

I am looking to do something that seems feasible, but searches on Google do not return something as precise as what I need.

我们从以前的网站本地化公司那里继承了 Nant 脚本.他们工作得很好.

We inherited Nant scripts from a previous company that localizes websites. They work great.

我们有自己的 Ant 脚本,可以比较两个 SVN 存储库,然后合并它们.我们想在 Ant 脚本运行时调用 Nant 脚本.

We have our own Ant scripts that compare two SVN repositories and then merge them. We would like to call the Nant script while the Ant scripts are run.

任何人都可以提供一些关于如何做到这一点的指导?我们不打算用 Ant 重写 Nant 脚本,所以请避免这种建议.

Anybody can provide some guidance as of how to do that? We are not looking to rewrite the Nant script in Ant, so please avoid that suggestion.

谢谢!

推荐答案

您调用将 ant 脚本放入批处理文件 (ant_tasks.bat) 中,然后使用 exec 从 nant 执行它.
类似的东西:

You call put your ant scripts in a batch file (ant_tasks.bat) and then execute it from nant using exec.
Something like that:

<target name="run-command">
   <exec program="ant_tasks.bat" basedir="${test.dir}">
     <arg value="${args}" />
   </exec>
 </target>

文档

或者您可以将您的 nant 脚本放在一个批处理文件中,然后使用 exec 从 ant 中执行它.

Or you can put your nant scripts in a batch file and then execute it from ant using exec.

示例:

<existing ant task>

<target name="help">
  <exec executable="cmd">
    <arg value="/c"/>
    <arg value="nant-scripts.bat"/>
    <arg value="-p"/>
  </exec>
</target>

<another existing ant task>

文档

这篇关于如何使用 Ant 运行 Nant 任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆