【发布时间】:2017-03-26 13:26:09
【问题描述】:
我使用QAF 与ant 作为构建脚本和IVY 作为依赖管理工具。为了自动 ivy 安装构建脚本有以下 ant 目标:
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}" />
<!-- download Ivy from web site so that it can be used even without any
special installation -->
<echo message="installing ivy..." />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
有 build.properties,其中属性 skip.download 通过提供相应的值 true 或 false 提供给下载常春藤 ON 或 OFF。
现在问题是我在 build.properties 中为 skip.download 提供的任何值,它认为它是 true,并且始终执行目标(下载 ivy)。
#not working
skip.download=false
我提到了IVY + Ant documentation,它具有类似的以下目标,但属性名称不同。
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
我找到了解决方法,因为解决方法需要删除或评论该属性才能跳过下载。
有什么方法可以使属性值正常工作,除非 目标中的属性?
【问题讨论】: