99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

Gradle Ant的屬性與引用

2020-07-24 16:02 更新

有許多方法可以設(shè)定 Ant 屬性,可以通過Ant任務(wù)使用屬性.您可以直接在AntBuilder的實(shí)例設(shè)置屬性。Ant的屬性也可以作為一個(gè)可改變的Map.也可以使用Ant的任務(wù)屬性,如下例所示:

例16.13.設(shè)置Ant屬性

build.gradle

ant.buildDir = buildDir
ant.properties.buildDir = buildDir
ant.properties['buildDir'] = buildDir
ant.property(name: 'buildDir', location: buildDir)

build.xml

<echo>buildDir = ${buildDir}</echo>

許多任務(wù)會(huì)在執(zhí)行時(shí)設(shè)置屬性.下面有幾種方法來獲取屬性值,可以直接從AntBuilder實(shí)例獲得屬性,如下所示,ant的屬性仍然是作為一個(gè)map:

例16.14.獲取Ant屬性

build.xml

<property name="antProp" value="a property defined in an Ant build"/>

build.gradle

println ant.antProp
println ant.properties.antProp
println ant.properties['antProp']

設(shè)置一個(gè)ant引用的方法:

例16.15.設(shè)置一個(gè)Ant引用

build.gradle

ant.path(id: 'classpath', location: 'libs')
ant.references.classpath = ant.path(location: 'libs')
ant.references['classpath'] = ant.path(location: 'libs')

build.xml

<path refid="classpath"/>

獲取Ant引用的方法:

例16.16.獲取一個(gè)Ant引用

build.xml

<path id="antPath" location="libs"/>

build.gradle

println ant.references.antPath
println ant.references['antPath']


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)