简体   繁体   English

蚂蚁的房产价值和房产位置有什么区别

[英]What‘s the difference between ant's property value and property location

Ant's config file--build.xml has the property element. Ant的配置文件 - build.xml具有property元素。 And according to the offical-doc,the property has the attributes-value and location. 根据官方文档,该属性具有属性值和位置。 But I don't understand why we need location? 但我不明白为什么我们需要位置? Can I set the path as a value in property? 我可以将路径设置为属性中的值吗? Then no need for location. 然后不需要位置。

location is used if you want to do relative paths. 如果要执行相对路径,则使用位置。

notice in this example, they use location. 在这个例子中,他们使用位置。 no absolute path needed. 不需要绝对路径。 http://ant.apache.org/manual/using.html http://ant.apache.org/manual/using.html

either location or value (mutually exclusive) can be used if you're doing absolute paths 如果您正在执行绝对路径,则可以使用位置或值(互斥)

Sets the property to the absolute filename of the given file. 将属性设置为给定文件的绝对文件名。 If the value of this attribute is an absolute path, it is left unchanged (with / and \\ characters converted to the current platforms conventions). 如果此属性的值是绝对路径,则保持不变(将/和\\字符转换为当前平台约定)。 Otherwise it is taken as a path relative to the project's basedir and expanded. 否则,它将被视为相对于项目基础的路径并进行扩展。

Source : http://ant.apache.org/manual/Tasks/property.html 资料来源: http//ant.apache.org/manual/Tasks/property.html

Example, someone want to store lib dir path in a variable then it can be done as shown below. 例如,有人想在变量中存储lib目录路径然后可以如下所示完成。

<property name="lib.dir" location ="project_home/lib"/>

and you can use the above property as shown below. 你可以使用上面的属性,如下所示。

<fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM