6
Jaka jest różnica między używaniem ext.varname
i def varname
. Na przykład. następujący kod wydaje się działać tak samo:Gradle def vs ext
task copyLicenses {
def outDir = project.buildDir.absolutePath + '/reports/license/'
doLast {
copy {
from 'licenses'
into outDir
include '*'
}
wydaje się działać dokładnie tak samo jak
task copyLicenses {
ext.outDir = project.buildDir.absolutePath + '/reports/license/'
doLast {
copy {
from 'licenses'
into outDir
include '*'
}