基于条件的 Ant 调用

标签 ant build build-automation

这就是我想要实现的目标:

如果设置了属性,则调用 antcall 目标。这是可行的吗?有人能告诉我怎么做吗?

<condition>
    <isset property="some.property">
        <antcall target="do.something">
    </isset>
</condition>

最佳答案

这样的事情应该工作:

<if>
    <isset property="some.property"/>
    <then>
        <antcall target="do.something"/>
    </then>
</if>

如果条件需要 ant-contrib ,但几乎所有对 ant 有用的东西也是如此。

关于基于条件的 Ant 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11231838/

相关文章:

typescript - 使用 yarn workspaces 和 lerna 优先构建顺序

ant - 将命令行参数传递给 ant

java - 在 Ant 中,如何指定文件名中带有逗号的文件?

java - 如何配置 exec-maven-plugin 类路径

python - 如何在 MacOS 上使用 Xcode 从源代码构建和调试 python 可执行文件(python 解释器)

svn - 如何确定以目录为根的最新SVN版本号?

plugins - Gradle新插件安装

makefile - CMake:指定构建工具链

ant - 如果 makefile 失败则停止 ant 构建

java - Ant 包含外部项目