Referencing one property from another property in gradle.properties


(Darshak Thakore) #1

I have a question about referencing one property from another in gradle.properties. This is somewhat similar to Apache Commons Configuration. I’m trying to do the following

gradle.properties file

prop1 = abc prop2 = $prop1/xyz

in build.gradle file println “Property 2: ${prop2}”

The expected output is

Property2: abc/xyz

Is this possible in gradle?


(Peter Niederwieser) #2

It’s not possible. ‘gradle.properties’ is a plain properties file. Whenever you need more than that, you should use a Gradle build script.


(Darshak Thakore) #3

thanks for the info. I wanted to make sure i’m not missing any “groovy gradle” magic :slight_smile: before i went down the path of writing my own logic.