Skip to content

Commit

Permalink
[feature/api_get_university] BuildConfig 적용 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed Nov 8, 2023
1 parent 76ca1bc commit 4c62043
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.konan.properties.Properties
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("com.android.application")
Expand All @@ -23,6 +24,10 @@ android {
}
}

val localPropertiesFile = rootProject.file("local.properties")
val localProperties = Properties()
localProperties.load(localPropertiesFile.inputStream())

buildTypes {
release {
isMinifyEnabled = false
Expand All @@ -31,6 +36,9 @@ android {
"proguard-rules.pro"
)
}
debug {
buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("BASE_URL")}\"")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -41,6 +49,7 @@ android {
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.7"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.everymeal.everymeal_android.di

import com.everymeal.data.service.onboarding.OnboardingApi
import com.everymeal.everymeal_android.BuildConfig
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import dagger.Module
import dagger.Provides
Expand All @@ -19,7 +20,7 @@ object NetworkModule {
private val contentType = "application/json".toMediaType()
private val json = Json { ignoreUnknownKeys = true }

private const val BASE_URL = "http://dev.everymeal.shop:8085"
private const val BASE_URL = BuildConfig.BASE_URL

@Provides
@Singleton
Expand Down

0 comments on commit 4c62043

Please sign in to comment.