1

In my gradle.properties file I have repetition of certain values. I want to create a single key-value pair for those values and wherever those values are referenced in gradle.properties file I want to point to the key which holds its value. is it possible to do so?

Eg. gradle.properties

name=xyz
place=xyz-1234

instead i want to write like

name=xyz
place=${name}-1234

The above is just example of use case. Have tried with $name and ${name} but not of help.. Can anyone please suggest here?

TheUser
  • 129
  • 1
  • 1
  • 10
  • Can you put them in another properties file, as in this question? https://stackoverflow.com/questions/37101589/how-to-read-a-properties-files-and-use-the-values-in-project-gradle-script – Feanor Sep 22 '21 at 22:08
  • gradle.properties is itself a property file, so not sure how will placing then in another properties file help here.. can you please elaborate with example.. the link pointed is not about referring another properties within gradle script, it looks to more about using it from build.gradle.. – TheUser Sep 23 '21 at 18:06

0 Answers0