依赖于另一个 ant 文件的 ant 文件 [英] ant file that depends on another ant file

查看:36
本文介绍了依赖于另一个 ant 文件的 ant 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个项目,每个项目都有自己的 ant 构建文件.

I have two projects, each with its own ant build file.

我应该怎么做,当我构建项目 B 时,它会首先使用项目 A 的 antfile 来构建项目 A?

What should I do so that, when I build project B, it will first build project A using project A's antfile?

推荐答案

您可以使用 ant 任务,它在外部构建文件上运行 ant.

You can achieve this by using the ant task, which runs ant on an external buildfile.

示例:

<ant antfile="../otherproject/build.xml" target="compile"/>

属性
默认情况下,所有当前属性都传递给调用的 ant 构建,如果您希望其他构建以本机方式运行,可以通过设置 inheritAll="false" 来禁用此功能.

需要的属性可以通过嵌套标签传递:

Properties that are need can be passed by nested tags:

<ant inheritAll="false" antfile="../otherproject/build.xml" target="compile">
  <property name="my.property" value="myValue"/>
</ant>

这篇关于依赖于另一个 ant 文件的 ant 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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