Pass env variables to gradle.properties
问题 I have a property set like this: url=localhost:3206 Is there a way to specifiy this like below instead: url=${hostname}:3206 回答1: I don't think gradle.properties supports interpolation. However, I would suggest an alternative means to accomplishing this: Have the following in your gradle.properties: hostname=localhost port=3206 Somewhere in your build.gradle, do the following: beforeEvaluate { ext.url = "$hostname:$port" } To configure the hostname or port, you have several options. I prefer