Skip to content

Commit

Permalink
Chore : 빌드 시 동일한 서명키로 빌드되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed May 25, 2024
1 parent af2312c commit a58d035
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ plugins {

android {
namespace = Config.android.nameSpace

defaultConfig {
signingConfig = signingConfigs.getByName("config")
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package store.newsbriefing.app.buildlogic.extension

import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Project
import java.util.Properties

internal fun Project.configureSigningConfig(
commonExtension: CommonExtension<*, *, *, *, *>,
) {
val keyStoreProperties = Properties().apply {
load(rootProject.file("keystore.properties").inputStream())
}

commonExtension.apply {
signingConfigs {
create("config") {
storeFile = file(keyStoreProperties["STORE_FILE"] as String)
storePassword = keyStoreProperties["STORE_PASSWORD"] as String
keyAlias = keyStoreProperties["KEY_ALIAS"] as String
keyPassword = keyStoreProperties["KEY_PASSWORD"] as String
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package store.newsbriefing.app.buildlogic.plugin

import com.android.build.api.dsl.ApplicationExtension
import com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPluginExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import store.newsbriefing.app.buildlogic.config.Config
import store.newsbriefing.app.buildlogic.extension.configureKotlinAndroid
import store.newsbriefing.app.buildlogic.extension.configureSecret
import store.newsbriefing.app.buildlogic.extension.configureSigningConfig

class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
Expand All @@ -27,6 +27,7 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
versionName = Config.android.versionName
}
configureKotlinAndroid(this)
configureSigningConfig(this)

packaging {
resources {
Expand Down

0 comments on commit a58d035

Please sign in to comment.