6
使用ext.varname
和def varname
有什麼區別?例如。下面的代碼似乎工作是一樣的:Gradle def vs ext
task copyLicenses {
def outDir = project.buildDir.absolutePath + '/reports/license/'
doLast {
copy {
from 'licenses'
into outDir
include '*'
}
似乎工作完全一樣
task copyLicenses {
ext.outDir = project.buildDir.absolutePath + '/reports/license/'
doLast {
copy {
from 'licenses'
into outDir
include '*'
}