Skip to content

Commit

Permalink
release apk signing 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
byungtak-lee committed Sep 23, 2024
1 parent 71db3a6 commit e280523
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.android.application)
Expand Down Expand Up @@ -26,18 +28,27 @@ android {
versionName = libs.versions.versionName.get()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
signingConfig = signingConfigs.getByName("debug")
}

signingConfigs {
create("release") {
keyAlias = getApiKey("key_alias")
keyPassword = getApiKey("key_password")
storeFile = file(getApiKey("keystore"))
storePassword = getApiKey("store_password")
}
}
buildTypes {
getByName("release") {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
getByName("debug") {
signingConfig = signingConfigs.getByName("debug")
isDebuggable = true
applicationIdSuffix = ".debug"
}
Expand Down Expand Up @@ -70,3 +81,7 @@ dependencies {
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
}

fun getApiKey(propertyKey: String): String {
return gradleLocalProperties(rootDir).getProperty(propertyKey)
}

0 comments on commit e280523

Please sign in to comment.