Can ConfigObject store functions and lazy-eval values?


(Gintautas Sulskus) #1

Firstly, can ConfigObject store functions, e.g.:

properties {
  myFunction = { println "stored function"  }
}

that could then be invoked in Gradle task as configObject.properties.myFunction()?

Secondly, can I use lazy evaluation for ConfigObject properties?

properties {
  prop2 = 'depends on ' + prop1
  prop1 = 'prop1 value'
}

At the moment the above prop2 evaluates to depends on [:]