Skip to content

Commit 9609fa6

Browse files
committed
[CHORE/#210] Debug, Release 환경에 따른 애드몹 환경 설정
1 parent f3f43e0 commit 9609fa6

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

app/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Properties
2+
13
plugins {
24
id("orbit.android.application")
35
id("orbit.android.compose")
@@ -16,8 +18,24 @@ android {
1618
}
1719

1820
buildTypes {
21+
val localProperties = Properties()
22+
localProperties.load(
23+
project.rootProject.file("local.properties").bufferedReader(),
24+
)
25+
debug {
26+
resValue(
27+
"string",
28+
"admob_app_id",
29+
localProperties["admobAppIdDebug"] as String,
30+
)
31+
}
1932
release {
2033
signingConfig = signingConfigs.getByName("debug")
34+
resValue(
35+
"string",
36+
"admob_app_id",
37+
localProperties["admobAppIdRelease"] as String,
38+
)
2139
}
2240
}
2341
}
@@ -41,4 +59,5 @@ dependencies {
4159
implementation(projects.feature.navigator)
4260
implementation(libs.firebase.analytics)
4361
implementation(libs.firebase.crashlytics)
62+
implementation(libs.play.services.ads)
4463
}

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
android:usesCleartextTraffic="true"
2626
tools:targetApi="31">
2727

28+
<meta-data
29+
android:name="com.google.android.gms.ads.APPLICATION_ID"
30+
android:value="@string/admob_app_id" />
31+
2832
<activity
2933
android:name="com.yapp.navigator.MainActivity"
3034
android:windowSoftInputMode="adjustResize"

feature/alarm-interaction/build.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
import com.yapp.convention.setNamespace
2+
import java.util.Properties
23

34
plugins {
45
id("orbit.android.feature")
56
}
67

78
android {
89
setNamespace("feature.alarm.interaction")
10+
11+
buildTypes {
12+
val localProperties = Properties()
13+
localProperties.load(
14+
project.rootProject.file("local.properties").bufferedReader(),
15+
)
16+
17+
debug {
18+
resValue(
19+
"string",
20+
"admob_ad_unit_id",
21+
localProperties["admobAdUnitIdDebug"] as String,
22+
)
23+
}
24+
release {
25+
resValue(
26+
"string",
27+
"admob_ad_unit_id",
28+
localProperties["admobAdUnitIdRelease"] as String,
29+
)
30+
}
31+
}
932
}
1033

1134
dependencies {
@@ -22,4 +45,5 @@ dependencies {
2245
implementation(libs.androidx.material.android)
2346
implementation(libs.androidx.annotation)
2447
implementation(libs.gson)
48+
implementation(libs.play.services.ads)
2549
}

gradle/libs.versions.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ gson = "2.11.0"
5858

5959
# Google Libraries Versions
6060
google-service = "4.4.2"
61+
playServicesAd = "24.2.0"
6162
firebase-bom = "33.1.1"
6263
firebase-app-distribution = "5.1.0"
6364
firebase-crashlytics = "3.0.3"
@@ -179,6 +180,8 @@ androidx-material-android = { group = "androidx.compose.material", name = "mater
179180

180181
amplitude-analytics = { group = "com.amplitude", name = "analytics-android", version.ref = "amplitude" }
181182

183+
play-services-ads = { group = "com.google.android.gms", name = "play-services-ads", version.ref = "playServicesAd" }
184+
182185
[plugins]
183186
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
184187
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

0 commit comments

Comments
 (0)