Is "storage" a reserved word


(Joseph Kunjoonju) #1

Is “storage” a reserved word? If so where can I find the list of reserved words?

This will not work:

task ‘storage’ {

ext.myProperty = “myValue” }

task printTaskProperties << {

println “${storage.myProperty}” }


(Peter Niederwieser) #2

It’s a name collision with the internal ‘DefaultPropertiesExtension.storage’ field. This field should be hidden by renaming it to something like ‘_storage’. I’ve raised GRADLE-2870 for this. In the meantime you can disambiguate with ‘println tasks.storage.myProperty’.

PS: Instead of ‘println “${x}”’, you can write ‘println x’.