Skip to content

Instantly share code, notes, and snippets.

@andhikayuana
Forked from mileskrell/build.gradle.kts
Created October 20, 2020 07:11
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 andhikayuana/5501eff15f0795e1e607c00341c142a4 to your computer and use it in GitHub Desktop.
Save andhikayuana/5501eff15f0795e1e607c00341c142a4 to your computer and use it in GitHub Desktop.
Example of declaring Android signing configs using Gradle Kotlin DSL
android {
signingConfigs {
getByName("debug") {
keyAlias = "debug"
keyPassword = "my debug key password"
storeFile = file("/home/miles/keystore.jks")
storePassword = "my keystore password"
}
create("release") {
keyAlias = "release"
keyPassword = "my release key password"
storeFile = file("/home/miles/keystore.jks")
storePassword = "my keystore password"
}
}
compileSdkVersion(28)
defaultConfig {
applicationId = "com.mileskrell.someneatapp"
minSdkVersion(19)
targetSdkVersion(28)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("release")
isDebuggable = false
}
getByName("debug") {
signingConfig = signingConfigs.getByName("debug")
isDebuggable = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment