Is there any documentation anywhere about how to a...
# gradle
s
Is there any documentation anywhere about how to add an environment variable from a
local.properties
file into a buildscript with the gradle kotlin dsl? I can only find really old posts that don't seem to work anymore. For context, I'm trying to load a GPG user/pass/keyring into my buildscript for publishing a release version of my project to sonatype.. if anyone knows a better way to do this I am all ears.
t
you can put your keys inside
~/.gradle/gradle.properties
or use environment variables
or use
java.util.Properties
to load
local.properties
and get keys
s
I am trying to input them via console from the example from the Gradle docs, will see how it goes
t
then you can use
-Pkey=some -Ppass=some-pass
params to gradle task
s
ooh good idea, I will do that
That will work with the Gradle Signing plugin?
t
is it to publish Gradle plugin?
or you referring to
maven-publish
?
s
Maven-Publish
t
https://docs.gradle.org/current/userguide/signing_plugin.html#signing_plugin - this actually what
maven-publish
is using for signing. So you can use
-Psigning,keyId=<key_id> -Psigning.pasword=<password>
s
Ooh thank you! Will try this out