https://kotlinlang.org logo
#android
Title
# android
m

Mutlu Celep

12/04/2019, 8:58 PM
I am setting credentials in my build.gradle.kts file. But I want to read the credentials from a json or gradle file, because I want to integrate with Jenkins. I am also open other solutions.
Copy code
repositories {
    maven { setUrl("<https://urbanairship.bintray.com/android>") }
    maven { setUrl("<https://clojars.org/repo/>") }
    maven {
        setUrl("<https://jfrog.io/>...")
        credentials {
            username = "..."
            password = "...."
        }
    }
    mavenCentral()
}
c

Casey Brooks

12/04/2019, 9:25 PM
You have lots of options available, such as using
gradle.properties
files, setting environment variables, and more. This page in their docs outlines all the ways to pass credentials to Gradle https://docs.gradle.org/current/userguide/build_environment.html
👍 2
m

Mutlu Celep

12/04/2019, 11:38 PM
I found this https://docs.gradle.org/current/userguide/kotlin_dsl.html#project_properties We can access global gradle.properties with "by project"
127 Views