Slackbot
11/11/2022, 12:00 AMStylianos Gakis
11/13/2022, 8:15 PMextra["FOO"] as String
in that context, and it will work, maybe give this a try?
Although I do have an issue about it myself, as shown here regarding some verbosity.Nuh Koca
11/13/2022, 8:37 PMproviders.gradleProperty
looks up both `gradle.properties`(no matters local or global) and environment variables if value isn’t present in gradle.properties
. However, you need to be careful about that environment variables must start with ORG_GRADLE_PROJECT
prefix. That actually solved my problem
maven("url") {
credentials {
password = proviers.gradleProperty("MY_TOKEN").get() // will look up for MY_TOKEN in gradle.properties or ORG_GRADLE_PROJECT_MY_TOKEN in env vars
}
}
Stylianos Gakis
11/13/2022, 8:43 PMProvider
, so I guess we have to do .getOrElse on it, which potentially makes my function even simpler since I can avoid doing .has().
So in the end it can all be just providers.gradleProperty("KEY").getOrElse(System.getenv("KEY"))
and this way I also avoid the prefix. Sounds great tbh!Nuh Koca
11/13/2022, 9:05 PMget()
function.
I checked your post but still don’t understand how one can access to any properties
file inside settings.gradle
. extra
won’t also help in this case. Did you find any solution or am I missing somethingStylianos Gakis
11/13/2022, 9:15 PMproject
in there. So in that case doing providers.gradleProperty
as you suggested must be the solution.Stylianos Gakis
11/13/2022, 9:25 PM