Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何获取ant构建xml文件&x27;她自己的名字?_Ant_Filenames - Fatal编程技术网

如何获取ant构建xml文件&x27;她自己的名字?

如何获取ant构建xml文件&x27;她自己的名字?,ant,filenames,Ant,Filenames,假设我有一个名为build\u dev\u linux.xml的文件 我的问题是 如何找到ant脚本XML文件自己的名称,build\u dev\u linux.XML 所以我可以把它放在XML文件中的变量或属性上。?Ant定义了一个有用的内置属性列表: basedir the absolute path of the project's basedir (as set with the basedir attribute of &

假设我有一个名为
build\u dev\u linux.xml
的文件

我的问题是

如何找到ant脚本XML文件自己的名称,
build\u dev\u linux.XML

所以我可以把它放在XML文件中的变量或属性上。?

Ant定义了一个有用的内置属性列表:

basedir             the absolute path of the project's basedir (as set
                    with the basedir attribute of <project>).
ant.file            the absolute path of the buildfile.
ant.version         the version of Ant
ant.project.name    the name of the project that is currently executing;
                    it is set in the name attribute of <project>.
ant.project.default-target
                    the name of the currently executing project's
                    default target;  it is set via the default
                    attribute of <project>.
ant.project.invoked-targets
                    a comma separated list of the targets that have
                    been specified on the command line (the IDE,
                    an <ant> task ...) when invoking the current
                    project.
ant.java.version    the JVM version Ant detected; currently it can hold
                    the values "1.2", "1.3",
                    "1.4",  "1.5" and "1.6".
ant.core.lib        the absolute path of the ant.jar file.

为什么不能直接设置包含名称的属性以减少处理点的次数。我不知道从哪里开始,现在我想我有了一个。:
也可能有用,请参阅
<basename file="${ant.file}" property="buildfile"/>