Skip to content

Commit

Permalink
fix emulator bux
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Weaver authored and Cody Weaver committed Dec 23, 2023
1 parent 114ba03 commit 11413b9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
13 changes: 13 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,20 @@ android {
}

buildTypes {
debug {
isMinifyEnabled = false
isDebuggable = true
isDefault = true
buildConfigField("Boolean", "DEBUG", "true")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}

release {
isMinifyEnabled = false
isDebuggable = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -47,6 +59,7 @@ android {
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/android/pocketalchemy/PaApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ package com.android.pocketalchemy
import android.app.Application
import dagger.hilt.android.HiltAndroidApp

object Config {
const val DEBUG = true
}

@HiltAndroidApp
class PaApplication: Application()
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.android.pocketalchemy.firebase

import android.util.Log
import com.android.pocketalchemy.BuildConfig
import com.google.firebase.Firebase
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.auth
Expand All @@ -20,7 +21,7 @@ object AuthProvider {
fun provideFirebaseAuth(): FirebaseAuth {
val firebaseAuth = Firebase.auth

if (/*Config.DEBUG*/false) {
if (BuildConfig.DEBUG) {
// Use emulator for debug
Log.d(TAG, "Connecting to emulator...")
firebaseAuth.useEmulator(EMULATOR_HOST, AUTH_EMULATOR_PORT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.android.pocketalchemy.firebase

import android.util.Log
import com.android.pocketalchemy.Config
import com.android.pocketalchemy.BuildConfig
import com.google.firebase.Firebase
import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.firestore.firestore
Expand All @@ -21,7 +21,7 @@ object FirestoreProvider {
fun provideFirestore(): FirebaseFirestore {
val firebaseFirestore = Firebase.firestore

if (Config.DEBUG) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "Connecting to emulator...")
firebaseFirestore.useEmulator(EMULATOR_HOST, FIRESTORE_EMULATOR_PORT)
}
Expand Down

0 comments on commit 11413b9

Please sign in to comment.