diff options
author | Michael <betheg@bitcloner.org> | 2015-08-29 09:26:51 +0200 |
---|---|---|
committer | Michael <betheg@bitcloner.org> | 2015-08-29 09:35:19 +0200 |
commit | beafaecc4912139a1b378a8ea5c3590c2cb4ff4f (patch) | |
tree | f0d8287924f14320a276c2e07ac317dd7c25e308 | |
parent | c6c5ffa5dde2cef785f4c66e2ec3322d542f109c (diff) |
a way to generating signed release APK using gradle.
-rw-r--r-- | app/build.gradle | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/build.gradle b/app/build.gradle index d2c3cf27..3b800d75 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,6 +26,33 @@ android { packagingOptions { exclude '.readme' } + + // + // To sign release builds, create the file `gradle.properties` in + // $HOME/.gradle or in your project directory with this content: + // + // mStoreFile=/path/to/key.store + // mStorePassword=xxx + // mKeyAlias=alias + // mKeyPassword=xxx + // + if (project.hasProperty('mStoreFile') && + project.hasProperty('mStorePassword') && + project.hasProperty('mKeyAlias') && + project.hasProperty('mKeyPassword')) { + signingConfigs { + release { + storeFile file(mStoreFile) + storePassword mStorePassword + keyAlias mKeyAlias + keyPassword mKeyPassword + } + } + buildTypes.release.signingConfig = signingConfigs.release + } else { + buildTypes.release.signingConfig = null + } + } dependencies { |