Dotted properties in Gradle

What would the dotted syntax look like in the Gradle scripts?

To set a project property, you would use ‘setProperty(“foo.bar”, someValue)’. To read it, you would use ‘property(“foo.bar”)’.

I understand the concept of build objects having properties, however I would like to keep a Java-like properties file for setting build configuration versus a Groovy syntax.

The drawback of this approach is that you will end up using two build languages: a (very limited) properties language, and the Gradle build script language. I’ve seen many people starting out with this approach (because it seemed more familiar) and eventually switching over to a pure Gradle build script approach.

Are there any tips for implementing such a scheme as a plugin? Basically parsing a properties file and converting them to nested properties and vice versa?

You’d use Groovy meta-programming. For example, you might loop through the parts of the dotted property expression and get/set them with ‘currentObject.“$part”’.