2016-09-16 62 views

回答

0

你可以在命令行上指定的所有属性

<propertyset id="commandline-properties"> 
    <propertyref builtin="commandline"/> 
</propertyset> 

,并使用<echoproperties>向他们展示。 propertyset还将包含一些与命令行相关的特殊Ant属性 - ant.file中的构建文件,ant.file.type中的构建文件类型以及ant.project.invoked-targets中命令行调用的目标。例如

$ cat < props.xml 
<project> 
    <echoproperties> 
    <propertyset> 
     <propertyref builtin="commandline"/> 
    </propertyset> 
    </echoproperties> 
</project> 
$ ant -f props.xml -Dfoo=bar -Dxyzzy=quoox 
Buildfile: /tmp/props.xml 
[echoproperties] #Ant properties 
[echoproperties] #Fri Sep 16 22:21:51 CEST 2016 
[echoproperties] ant.file=/tmp/props.xml 
[echoproperties] ant.file.type=file 
[echoproperties] ant.project.invoked-targets= 
[echoproperties] foo=bar 
[echoproperties] xyzzy=quoox 

BUILD SUCCESSFUL 
Total time: 0 seconds