1- import java.util.Properties
1+ import com.threegap.bitnagil.convention.extension.propertyOrNull
2+ import com.threegap.bitnagil.convention.extension.requireProperty
23
34plugins {
45 alias(libs.plugins.bitnagil.android.application)
@@ -7,34 +8,17 @@ plugins {
78}
89
910android {
10- val properties =
11- Properties ().apply {
12- val propFile = rootProject.file(" local.properties" )
13- if (propFile.exists()) {
14- load(propFile.inputStream())
15- }
16- }
17-
1811 signingConfigs {
1912 create(" release" ) {
20- keyAlias = properties[" release.key.alias" ] as ? String
21- ? : System .getenv(" RELEASE_KEY_ALIAS" )
22- ? : throw GradleException (" RELEASE_KEY_ALIAS 값이 없습니다." )
23- keyPassword = properties[" release.key.password" ] as ? String
24- ? : System .getenv(" RELEASE_KEY_PASSWORD" )
25- ? : throw GradleException (" RELEASE_KEY_PASSWORD 값이 없습니다." )
26- storePassword = properties[" release.keystore.password" ] as ? String
27- ? : System .getenv(" RELEASE_KEYSTORE_PASSWORD" )
28- ? : throw GradleException (" RELEASE_KEYSTORE_PASSWORD 값이 없습니다." )
29- storeFile = File (" ${properties[" release.keystore.path" ]} " )
13+ keyAlias = requireProperty(" release.key.alias" , " RELEASE_KEY_ALIAS" )
14+ keyPassword = requireProperty(" release.key.password" , " RELEASE_KEY_PASSWORD" )
15+ storePassword = requireProperty(" release.keystore.password" , " RELEASE_KEYSTORE_PASSWORD" )
16+ storeFile = File (" ${propertyOrNull(" release.keystore.path" , " RELEASE_KEYSTORE_PATH" )} " )
3017 }
3118 }
3219
3320 defaultConfig {
34- val kakaoNativeAppKey =
35- (properties[" kakao.native.app.key" ] as ? String )
36- ? : System .getenv(" KAKAO_NATIVE_APP_KEY" )
37- ? : throw GradleException (" KAKAO_NATIVE_APP_KEY 값이 없습니다." )
21+ val kakaoNativeAppKey = requireProperty(" kakao.native.app.key" , " KAKAO_NATIVE_APP_KEY" )
3822
3923 manifestPlaceholders[" KAKAO_NATIVE_APP_KEY" ] = kakaoNativeAppKey
4024 buildConfigField(
@@ -43,10 +27,7 @@ android {
4327 value = " \" $kakaoNativeAppKey \" " ,
4428 )
4529
46- val kakaoRestApiKey =
47- (properties[" kakao.rest.api.key" ] as ? String )
48- ? : System .getenv(" KAKAO_REST_API_KEY" )
49- ? : throw GradleException (" KAKAO_REST_API_KEY 값이 없습니다." )
30+ val kakaoRestApiKey = requireProperty(" kakao.rest.api.key" , " KAKAO_REST_API_KEY" )
5031
5132 buildConfigField(
5233 type = " String" ,
@@ -61,17 +42,14 @@ android {
6142 versionNameSuffix = " -DEBUG"
6243 isDebuggable = true
6344
64- val devUrl = properties[" bitnagil.dev.url" ] as ? String
65- ? : System .getenv(" BITNAGIL_DEV_URL" )
66- ? : throw GradleException (" bitnagil.dev.url 값이 없습니다." )
45+ val devUrl = requireProperty(" bitnagil.dev.url" , " BITNAGIL_DEV_URL" )
6746 buildConfigField(" String" , " BASE_URL" , " \" $devUrl \" " )
6847 }
6948
7049 release {
71- val prodUrl = properties[" bitnagil.prod.url" ] as ? String
72- ? : System .getenv(" BITNAGIL_PROD_URL" )
73- ? : throw GradleException (" bitnagil.prod.url 값이 없습니다." )
50+ val prodUrl = requireProperty(" bitnagil.prod.url" , " BITNAGIL_PROD_URL" )
7451 buildConfigField(" String" , " BASE_URL" , " \" $prodUrl \" " )
52+
7553 isMinifyEnabled = true
7654 isShrinkResources = true
7755 proguardFiles(
@@ -88,6 +66,7 @@ android {
8866}
8967
9068dependencies {
69+ implementation(projects.core.analytics)
9170 implementation(projects.core.datastore)
9271 implementation(projects.core.designsystem)
9372 implementation(projects.core.network)
0 commit comments