Skip to content

Instantly share code, notes, and snippets.

@VladimirMi
Last active February 22, 2018 07:14
Show Gist options
  • Save VladimirMi/101fe2c67145e2a6fa4b627d706b0f80 to your computer and use it in GitHub Desktop.
Save VladimirMi/101fe2c67145e2a6fa4b627d706b0f80 to your computer and use it in GitHub Desktop.
Adding variables to BuildConfig
def secretsProperties = new Properties()
secretsProperties.load(new FileInputStream("secrets.properties"))
android {
defaultConfig {
buildConfigField("String", "API_KEY", "\"${secretsProperties['apiKey']}\"")
}
}
apiKey=your_api_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment