Skip to content

Instantly share code, notes, and snippets.

@jaiselrahman
Last active August 22, 2021 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaiselrahman/612abb355bdfacb08a7df99972137471 to your computer and use it in GitHub Desktop.
Save jaiselrahman/612abb355bdfacb08a7df99972137471 to your computer and use it in GitHub Desktop.
def propertiesFile = project.rootProject.file('local.properties')
if (propertiesFile.exists()) {
Properties properties = new Properties()
properties.load(propertiesFile.newDataInputStream())
ext.SECRET_KEY = properties.getProperty('SECRET_KEY') ?: ""
} else {
ext.SECRET_KEY = System.getenv('SECRET_KEY') ?: ""
}
...
android {
defaultConfig {
...
resValue 'string', 'application_id', applicationId
resValue 'string', 'version_name', versionName
resValue 'string', 'secret_key', SECRET_KEY
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment