Andrey Aleev
Andrey Aleev

Reputation: 321

How do I read properties defined in local.properties in gradle.properties

In my Android Studio project I have proxy settings defined in gradle.properties file, that is synched with Git repo. As long as I have my proxy password defined there, I need to move it into local.properties file. I want to achive smth like this:

in gradle.properties:

systemProp.http.proxyPassword=<local.properties>.proxy_pass

and in local.properties:

proxy_pass="PASSWORD"

How can I do that?

Upvotes: 0

Views: 1638

Answers (1)

Lukas K&#246;rfer
Lukas K&#246;rfer

Reputation: 14493

This won't happen, because Java Properties are simple strings, there is no logic applied automatically.

However, you can simply use a gradle.properties file in the .gradle folder of your user home directory to define environment-related settings instead of project-related settings. This file won't be uploaded to a VCS.

Upvotes: 1

Related Questions