Skip to content

Instantly share code, notes, and snippets.

@piruin
Last active April 12, 2016 07:10
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 piruin/3fcc678de3ab5b4806924b6fd47cfce4 to your computer and use it in GitHub Desktop.
Save piruin/3fcc678de3ab5b4806924b6fd47cfce4 to your computer and use it in GitHub Desktop.
Gradle get property from system variable or local.properties
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
sendbirdAppId = System.hasProperty("SENDBIRD_APP_ID") ? System.getenv('SENDBIRD_APP_ID') : properties.getProperty("sendbird.app-id")
sendbirdApiToken = System.hasProperty("SENDBIRD_API_TOKEN") ? System.getenv('SENDBIRD_API_TOKEN') : properties.getProperty("sendbird.api-token")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment