What is the difference between using ext.varname
and def varname
. E.g. the following code seems to work the same:
task copyLicenses {
def outDir = project.buildDir.absolutePath + '/reports/license/'
doLast {
copy {
from 'licenses'
into outDir
include '*'
}
seems to work exactly the same as
task copyLicenses {
ext.outDir = project.buildDir.absolutePath + '/reports/license/'
doLast {
copy {
from 'licenses'
into outDir
include '*'
}