feat(release): release 서명 설정을 추가한다
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -64,9 +64,11 @@ captures/
|
|||||||
.idea/deploymentTargetSelector.xml
|
.idea/deploymentTargetSelector.xml
|
||||||
|
|
||||||
# Keystore files
|
# Keystore files
|
||||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
*.jks
|
||||||
#*.jks
|
*.keystore
|
||||||
#*.keystore
|
*.p12
|
||||||
|
*.pem
|
||||||
|
*.key
|
||||||
|
|
||||||
# External native build folder generated in Android Studio 2.2 and later
|
# External native build folder generated in Android Studio 2.2 and later
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
@@ -13,6 +15,27 @@ plugins {
|
|||||||
id 'com.google.firebase.crashlytics'
|
id 'com.google.firebase.crashlytics'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def localProperties = new Properties()
|
||||||
|
def localPropertiesFile = rootProject.file('local.properties')
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
localPropertiesFile.withInputStream { stream ->
|
||||||
|
localProperties.load(stream)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def releaseSigningPropertyKeys = [
|
||||||
|
'RELEASE_STORE_FILE',
|
||||||
|
'RELEASE_STORE_PASSWORD',
|
||||||
|
'RELEASE_KEY_ALIAS',
|
||||||
|
'RELEASE_KEY_PASSWORD'
|
||||||
|
]
|
||||||
|
def releaseSigningProperty = { key ->
|
||||||
|
localProperties.getProperty(key)?.trim()
|
||||||
|
}
|
||||||
|
def missingReleaseSigningProperties = {
|
||||||
|
releaseSigningPropertyKeys.findAll { key -> !releaseSigningProperty(key) }
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace 'kr.co.vividnext.sodalive'
|
namespace 'kr.co.vividnext.sodalive'
|
||||||
compileSdk = 35
|
compileSdk = 35
|
||||||
@@ -68,8 +91,25 @@ android {
|
|||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
def releaseStoreFile = releaseSigningProperty('RELEASE_STORE_FILE')
|
||||||
|
def releaseStorePassword = releaseSigningProperty('RELEASE_STORE_PASSWORD')
|
||||||
|
def releaseKeyAlias = releaseSigningProperty('RELEASE_KEY_ALIAS')
|
||||||
|
def releaseKeyPassword = releaseSigningProperty('RELEASE_KEY_PASSWORD')
|
||||||
|
|
||||||
|
if (missingReleaseSigningProperties().isEmpty()) {
|
||||||
|
storeFile rootProject.file(releaseStoreFile)
|
||||||
|
storePassword releaseStorePassword
|
||||||
|
keyAlias releaseKeyAlias
|
||||||
|
keyPassword releaseKeyPassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
signingConfig signingConfigs.release
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
|
||||||
@@ -172,6 +212,36 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gradle.taskGraph.whenReady { taskGraph ->
|
||||||
|
def requiresReleaseSigning = taskGraph.allTasks.any { task ->
|
||||||
|
def taskName = task.name.toLowerCase(Locale.US)
|
||||||
|
taskName.contains('release') && (
|
||||||
|
taskName.startsWith('assemble') ||
|
||||||
|
taskName.startsWith('bundle') ||
|
||||||
|
taskName.startsWith('install') ||
|
||||||
|
taskName.startsWith('package')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!requiresReleaseSigning) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
def missingProperties = missingReleaseSigningProperties()
|
||||||
|
if (!missingProperties.isEmpty()) {
|
||||||
|
throw new GradleException(
|
||||||
|
"Release signing properties are missing in local.properties: ${missingProperties.join(', ')}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
def releaseStoreFile = rootProject.file(releaseSigningProperty('RELEASE_STORE_FILE'))
|
||||||
|
if (!releaseStoreFile.exists()) {
|
||||||
|
throw new GradleException(
|
||||||
|
"Release signing store file does not exist: ${releaseStoreFile}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "androidx.media:media:1.7.1"
|
implementation "androidx.media:media:1.7.1"
|
||||||
implementation 'androidx.core:core-ktx:1.16.0'
|
implementation 'androidx.core:core-ktx:1.16.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user