From 117366b23f381792e512af06d15c4b981e9e4426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AA=85=EC=84=9D?= Date: Sun, 9 Apr 2023 23:57:33 +0900 Subject: [PATCH] =?UTF-8?q?Issues=20#287=20feat:=20keystore.properties=20?= =?UTF-8?q?=EC=97=90=EC=84=9C=20API=20KEY=20=EB=A5=BC=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +-- app/build.gradle.kts | 9 +++++++-- data/data-remote/build.gradle.kts | 15 +++++++++++++-- local.properties | 8 ++++++++ 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 local.properties diff --git a/.gitignore b/.gitignore index 91b3d4f18..64f81bd0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,10 @@ *.iml .gradle -/local.properties .DS_Store /build /captures .externalNativeBuild .cxx -local.properties +keystore.properties /.idea/ /buildSrc/build/ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 31792a5c7..9b945dda3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,7 @@ @file:Suppress("UnstableApiUsage") -import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties +import java.io.FileInputStream +import java.util.Properties @Suppress("DSL_SCOPE_VIOLATION") plugins { @@ -17,7 +18,11 @@ android { versionCode = 1 versionName = "1.0.0" - val naverMapApiId = gradleLocalProperties(rootDir).getProperty("naver_map_api_id") + val keystorePropertiesFile = rootProject.file("keystore.properties") + val keystoreProperties = Properties() + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) + + val naverMapApiId = keystoreProperties.getProperty("naver_map_api_id") manifestPlaceholders["naver_map_api_id"] = naverMapApiId } diff --git a/data/data-remote/build.gradle.kts b/data/data-remote/build.gradle.kts index fed4774ee..d4af3983a 100644 --- a/data/data-remote/build.gradle.kts +++ b/data/data-remote/build.gradle.kts @@ -1,4 +1,7 @@ -import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties +@file:Suppress("UnstableApiUsage") + +import java.io.FileInputStream +import java.util.Properties @Suppress("DSL_SCOPE_VIOLATION") plugins { @@ -10,8 +13,16 @@ plugins { android { namespace = "com.lighthouse.data.remote" + buildFeatures { + buildConfig = true + } + defaultConfig { - val kakaoSearchId = gradleLocalProperties(rootDir).getProperty("kakao_search_id") + val keystorePropertiesFile = rootProject.file("keystore.properties") + val keystoreProperties = Properties() + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) + + val kakaoSearchId = keystoreProperties.getProperty("kakao_search_id") buildConfigField("String", "kakaoSearchId", kakaoSearchId) } } diff --git a/local.properties b/local.properties new file mode 100644 index 000000000..cb2595e1a --- /dev/null +++ b/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Thu Feb 02 22:44:28 KST 2023 +sdk.dir=C\:\\Users\\Home\\AppData\\Local\\Android\\Sdk