android tutorial - Define signing configuration in a separate gradle file in android - android studio - android app developement
Define signing configuration in a separate gradle file in android
The simplest and cleanest way to add an external configuration is through a separate Gradle file build.gradle
apply from: './keystore.gradle'
android{
signingConfigs {
release {
storeFile file(keystore.storeFile)
storePassword keystore.storePassword
keyAlias keystore.keyAlias
keyPassword keystore.keyPassword
}
}
}
click below button to copy code from our android learning website - android tutorial - team
keystore.gradle
ext.keystore = [
storeFile : "/path/to/your/file",
storePassword: 'password of the store',
keyAlias : 'alias_of_the_key',
keyPassword : 'password_of_the_key'
]
click below button to copy code from our android learning website - android tutorial - team
The keystore.gradle file can exist anywhere in your file system, you can specify its location inside the
apply from: ''
click below button to copy code from our android learning website - android tutorial - team
at the top of your gradle file or at the end of your main project build.gradle file. Typically its a good idea to ignore this file from version control system such as git if its located inside your repo. It is also a good idea to provide a sample
keystore.gradle.sample
click below button to copy code from our android learning website - android tutorial - team
which developers entering the project would rename and populate on their development machine. This file would always be contained inside the repo at the correct location.