File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
src/main/java/woowacourse/shopping/data Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ import java.util.Properties
2
+
1
3
plugins {
2
4
id(" kotlin-kapt" )
3
5
alias(libs.plugins.android.application)
@@ -6,6 +8,14 @@ plugins {
6
8
alias(libs.plugins.serialization)
7
9
}
8
10
11
+ private val localProperties =
12
+ Properties ().apply {
13
+ val localFile = rootProject.file(" local.properties" )
14
+ if (localFile.exists()) {
15
+ load(localFile.inputStream())
16
+ }
17
+ }
18
+
9
19
android {
10
20
namespace = " woowacourse.shopping"
11
21
compileSdk = 35
@@ -25,6 +35,7 @@ android {
25
35
buildTypes {
26
36
debug {
27
37
buildConfigField(" boolean" , " DEBUG" , " true" )
38
+ buildConfigField(" String" , " BASE_URL" , localProperties[" base.url" ].toString())
28
39
}
29
40
release {
30
41
isMinifyEnabled = false
@@ -33,6 +44,7 @@ android {
33
44
" proguard-rules.pro" ,
34
45
)
35
46
buildConfigField(" boolean" , " DEBUG" , " false" )
47
+ buildConfigField(" String" , " BASE_URL" , localProperties[" base.url" ].toString())
36
48
}
37
49
}
38
50
compileOptions {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ object API {
20
20
private val retrofit =
21
21
Retrofit
22
22
.Builder ()
23
- .baseUrl(" http://techcourse-lv2-alb-974870821.ap-northeast-2.elb.amazonaws.com " )
23
+ .baseUrl(BuildConfig . BASE_URL )
24
24
.client(client)
25
25
.addConverterFactory(Json .asConverterFactory(" application/json" .toMediaType()))
26
26
.build()
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import woowacourse.shopping.data.product.dto.ProductsResponse
17
17
import java.util.Base64
18
18
19
19
class ProductsHttpClient (
20
- private val baseUrl : String = " http://techcourse-lv2-alb-974870821.ap-northeast-2.elb.amazonaws.com " ,
20
+ private val baseUrl : String = BuildConfig . BASE_URL ,
21
21
) {
22
22
fun getCart (
23
23
page : Int ,
You can’t perform that action at this time.
0 commit comments