Is there any gradle function/plugin to read/bind some secret properties (api keys, passwords) from special config/properties files?
For instance, in android plugin you can set properties in ~/.gradle/gradle.properties file:
apiKey=SUPER_SECRET_VALUE
than in project build.gradle:
android {
buildTypes {
debug {
buildConfigField "String", "API_KEY", apiKey
}
}
}
And in project itself you use BuildConfig.API_KEY
string constant.
Is there any similar solutions in gradle for other (java) projects?
Or may be this approach is wrong and some other workaround should be used?