BIT-946: Add Google Services and Crashlytics to standard builds (#473)

This commit is contained in:
Sean Weiser 2024-01-02 16:31:45 -06:00 committed by Álison Fernandes
parent 9bf07f0693
commit fd9ca8f544
5 changed files with 103 additions and 3 deletions

View file

@ -1,5 +1,10 @@
import com.google.firebase.crashlytics.buildtools.gradle.tasks.InjectMappingFileIdTask
import com.google.firebase.crashlytics.buildtools.gradle.tasks.UploadMappingFileTask
import com.google.gms.googleservices.GoogleServicesTask
plugins { plugins {
alias(libs.plugins.android.application) alias(libs.plugins.android.application)
alias(libs.plugins.crashlytics)
alias(libs.plugins.detekt) alias(libs.plugins.detekt)
alias(libs.plugins.hilt) alias(libs.plugins.hilt)
alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.android)
@ -7,6 +12,7 @@ plugins {
alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlinx.kover) alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.ksp) alias(libs.plugins.ksp)
alias(libs.plugins.google.services)
kotlin("kapt") kotlin("kapt")
} }
@ -89,6 +95,10 @@ android {
} }
dependencies { dependencies {
fun standardImplementation(dependencyNotation: Any) {
add("standardImplementation", dependencyNotation)
}
implementation(libs.androidx.activity.compose) implementation(libs.androidx.activity.compose)
implementation(libs.androidx.browser) implementation(libs.androidx.browser)
implementation(platform(libs.androidx.compose.bom)) implementation(platform(libs.androidx.compose.bom))
@ -107,11 +117,8 @@ dependencies {
implementation(libs.androidx.room.ktx) implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.runtime) implementation(libs.androidx.room.runtime)
implementation(libs.androidx.splashscreen) implementation(libs.androidx.splashscreen)
implementation(platform(libs.google.firebase.bom))
implementation(libs.bitwarden.sdk) implementation(libs.bitwarden.sdk)
implementation(libs.bumptech.glide) implementation(libs.bumptech.glide)
implementation(libs.google.firebase.cloud.messaging)
implementation(libs.google.firebase.crashlytics)
implementation(libs.google.hilt.android) implementation(libs.google.hilt.android)
kapt(libs.google.hilt.compiler) kapt(libs.google.hilt.compiler)
implementation(libs.jakewharton.retrofit.kotlinx.serialization) implementation(libs.jakewharton.retrofit.kotlinx.serialization)
@ -128,6 +135,11 @@ dependencies {
debugImplementation(libs.androidx.compose.ui.test.manifest) debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation(libs.androidx.compose.ui.tooling) debugImplementation(libs.androidx.compose.ui.tooling)
// Standard-specific flavor dependencies
standardImplementation(libs.google.firebase.cloud.messaging)
standardImplementation(platform(libs.google.firebase.bom))
standardImplementation(libs.google.firebase.crashlytics)
testImplementation(libs.androidx.compose.ui.test) testImplementation(libs.androidx.compose.ui.test)
testImplementation(libs.google.hilt.android.testing) testImplementation(libs.google.hilt.android.testing)
testImplementation(libs.junit.junit5) testImplementation(libs.junit.junit5)
@ -207,3 +219,13 @@ tasks {
useJUnitPlatform() useJUnitPlatform()
} }
} }
afterEvaluate {
// Disable Fdroid-specific tasks that we want to exclude
val tasks = tasks.withType<GoogleServicesTask>() +
tasks.withType<InjectMappingFileIdTask>() +
tasks.withType<UploadMappingFileTask>()
tasks
.filter { it.name.contains("Fdroid") }
.forEach { it.enabled = false }
}

View file

@ -0,0 +1,73 @@
{
"project_info": {
"project_number": "1093287226212",
"firebase_url": "https://bitwarden-dev.firebaseio.com",
"project_id": "bitwarden-dev",
"storage_bucket": "bitwarden-dev.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1093287226212:android:f8d67b786db1b844",
"android_client_info": {
"package_name": "com.x8bit.bitwarden.dev"
}
},
"oauth_client": [
{
"client_id": "1093287226212-m4mv8ho387tdgosc9lsltnmruul7ouo0.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA4Xkn0do7Ky_OLff2L_7MXeNK6s-JVgXg"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:1093287226212:android:f8d67b786db1b844",
"android_client_info": {
"package_name": "com.x8bit.bitwarden"
}
},
"oauth_client": [
{
"client_id": "1093287226212-m4mv8ho387tdgosc9lsltnmruul7ouo0.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA4Xkn0do7Ky_OLff2L_7MXeNK6s-JVgXg"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

Binary file not shown.

View file

@ -5,4 +5,5 @@ plugins {
alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlinx.kover) apply false alias(libs.plugins.kotlinx.kover) apply false
alias(libs.plugins.ksp) apply false alias(libs.plugins.ksp) apply false
alias(libs.plugins.google.services) apply false
} }

View file

@ -24,9 +24,11 @@ androidxSplash = "1.1.0-alpha02"
# Once the app and SDK reach a critical point of completeness we should begin fixing the version # Once the app and SDK reach a critical point of completeness we should begin fixing the version
# here (BIT-311). # here (BIT-311).
bitwardenSdk = "0.3.1-20231221.163756-59" bitwardenSdk = "0.3.1-20231221.163756-59"
crashlytics = "2.9.9"
detekt = "1.23.1" detekt = "1.23.1"
firebaseBom = "32.7.0" firebaseBom = "32.7.0"
glide = "1.0.0-beta01" glide = "1.0.0-beta01"
googleServices = "4.4.0"
hilt = "2.48" hilt = "2.48"
junit5 = "5.8.2" junit5 = "5.8.2"
jvmTarget = "1.8" jvmTarget = "1.8"
@ -98,7 +100,9 @@ zxing-zxing-core = { module = "com.google.zxing:core", version.ref = "zxing" }
[plugins] [plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }