title: Proper way to use System environment variables in gradle using Android Studio
body: <p>I am using Android Studio to build my project on an Ubuntu 14.04 system.</p>
  
  <p>I wrote the following in my build.gradle files to avoid hardcoding storeFile, storePassword, keyAlias and keyPassword in my git repo:</p>
  
  <pre><code>signingConfigs {
   debug {
  
      storeFile file(System.getenv("KEYSTORE"))
      storePassword System.getenv("KEYSTORE_PASSWORD")
      keyAlias System.getenv("KEY_ALIAS")
      keyPassword System.getenv("KEY_PASSWORD")        
   }
  </code></pre>
  
  <p>But gradle sync errors out with the following: <code>Error:(49, 0) Neither path nor baseDir may be null or empty string. path='null' basedir='./pathto/TMessagesProj'</code></p>
  
  <p>My .bashrc contains: <code>source ~/.gradlerc</code> and my ~/.gradlerc contains the following:</p>
  
  <pre><code>export KEYSTORE="/home/myname/keystore/mykey"
  export KEYSTORE_PASSWORD='mypass'
  export KEY_ALIAS='mykey'
  export KEY_PASSWORD='keypass'
  </code></pre>
  
  <p>I've confirmed that these variables are imported correctly by the shell. However I'm unsure of why it isnt received by the build environment in Android Studio.</p>
  
  <p>What's the proper way to use environment variables in gradle?</p>