Skip to content

Commit

Permalink
[MOB-75] Use new server for debug hosted on Firebase (#17)
Browse files Browse the repository at this point in the history
* Use new server hosted on Firebase

* Setup Live flavour

* Added exists check

* Update build.gradle.kts
  • Loading branch information
AmniX authored Sep 30, 2024
1 parent f349902 commit 3a20161
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 13 additions & 5 deletions example-android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import java.util.Properties

plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.compose.compiler)
}

val localProperties = Properties().apply {
if (rootProject.file("local.properties").exists()) {
rootProject.file("local.properties").reader().use(::load)
}
}

android {
namespace = "com.degica.komoju.android"
compileSdk = 34
Expand Down Expand Up @@ -31,19 +39,19 @@ android {
productFlavors {
create("dev") {
dimension = "environment"
buildConfigField("String", "TEST_SERVER_URL", "\"https://rn-komoju-app.glitch.me/\"")
buildConfigField("String", "SERVER_URL", "\"${localProperties["TEST_SERVER_URL"]}\"")
}
create("live") {
dimension = "environment"
buildConfigField("String", "TEST_SERVER_URL", "\"https://live-komoju-app.glitch.me/\"")
buildConfigField("String", "SERVER_URL", "\"${localProperties["LIVE_SERVER_URL"]}\"")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
buildFeatures {
compose = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import retrofit2.http.POST

interface RemoteApiService {
@Headers("Content-Type: application/json", "Accept: application/json")
@GET("serve-keys")
@GET("serve-key")
suspend fun getPublishableKey(): Response<PublishableKeyResponse>

@Headers("Content-Type: application/json", "Accept: application/json")
Expand All @@ -32,7 +32,7 @@ interface RemoteApiService {
.build(),
)
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(BuildConfig.TEST_SERVER_URL)
.baseUrl(BuildConfig.SERVER_URL)
.build()
.create(RemoteApiService::class.java)
}
Expand Down

0 comments on commit 3a20161

Please sign in to comment.