Slackbot
10/28/2022, 11:59 AMThomas Broyer
10/28/2022, 12:08 PMval foo: String by settings or its "extras" with extra["foo"] (assuming Kotlin DSL here, with Groovy DSL I think you can just use settings.foo).
But you may want to prefer credentials(PasswordCredentials::class) after naming your repository: https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:handling_credentialsStylianos Gakis
10/28/2022, 12:13 PMextra["FOO"] as String
val foo: String by settings
Seem to work. Trick being that you need to be explicitly casting it to a String, which should be safe anyway.
Interesting, didn’t know about the PasswordCredentials, seems a bit more magic there, like it expects the keys to read exactly {name} plus `Password`|`Username` suffixes.
Meaning the key can not be SOME_THING_PASSWORD but would need to be SOME_THINGPassword or maybe even someThingPassword.
Not the end of the world I guess.Stylianos Gakis
10/28/2022, 12:14 PM