Use or not use project.ext prefix in included scripts


(Sverre Moe) #1

I have extracted my gradle packaging into a seperate packager.gradle

apply from: 'packager.gradle'

It is using several properties I have defined within

ext {
    projectName = project.name
}

It seems that the packager.gradle can read these properties in two ways:

projectName
project.ext.projectName

I was thinking the latter would help distinguish properties that are defined outside of the included gradle build script. However it adds additional perhaps unnecessary code. It helps clarity, but not brevity.

What do people prefer, to use or not to use project.ext prefix?