Skip to content

Commit

Permalink
Integrate Firebase (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz authored Nov 2, 2024
1 parent 36a940c commit 0adc54e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: Firebase
steps:
- uses: actions/checkout@v4

Expand All @@ -31,8 +32,18 @@ jobs:
- name: Make Gradle executable
run: chmod +x ./gradlew

- name: Firebase (Release) - Google Services.json file
env:
DATA: ${{ secrets.FIREBASE_GOOGLE_SERVICES_JSON_RELEASE }}
run: echo $DATA | base64 -di > app/google-services.json

- name: Firebase (Debug) - Google Services.json file
env:
DATA: ${{ secrets.FIREBASE_GOOGLE_SERVICES_JSON_DEBUG }}
run: echo $DATA | base64 -di > app/src/debug/google-services.json

- name: Detekt Checks
run: ./gradlew detekt

- name: Build with Gradle
run: ./gradlew build
run: ./gradlew assembleRelease
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ dependencies {
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.timber)

// Firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)

// Test
androidTestImplementation(libs.test.androidxTestExtJunit)
testImplementation(libs.test.composeUiTestJunit4)
testImplementation(libs.test.paparazzi)
Expand Down
2 changes: 2 additions & 0 deletions app/src/debug/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
keep for git

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
Expand All @@ -25,6 +26,7 @@ class ApplicationConventionPlugin : Plugin<Project> {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("org.jetbrains.kotlin.plugin.compose")
apply("com.google.gms.google-services")
}
extensions.configure<ApplicationExtension> {
compileSdk = compileSdkVersion
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.google.services) apply false
}

subprojects {
Expand Down
8 changes: 7 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ compose-bom = "2024.10.01"
compose-navigation = "2.8.3"
detekt = "1.23.7"
detektCompose = "0.4.17"
firebaseBom = "33.5.1"
hilt = "2.52"
hiltNavigationCompose = "1.2.0"
kotlinxCollectionsImmutable = "0.3.8"
Expand Down Expand Up @@ -55,10 +56,14 @@ compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling
compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "compose-navigation" }
compose-material3 = { group = "androidx.compose.material3", name = "material3", version = "1.3.1" }

#Firebase
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebaseBom" }
firebase-analytics = { module = "com.google.firebase:firebase-analytics" }

#Hilt
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNavigationCompose" }

#Network
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
Expand Down Expand Up @@ -102,6 +107,7 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
wire = { id = "com.squareup.wire", version.ref = "wire" }
cash-sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
google-services = { id = "com.google.gms.google-services", version = "4.4.2" }

#Convention Plugins
krail-android-application = { id = "krail.android.application", version = "unspecified" }
Expand Down

0 comments on commit 0adc54e

Please sign in to comment.