Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-009] 파이어베이스 크래시리틱스 추가 #28

Merged
merged 13 commits into from
May 30, 2022
Merged
169 changes: 166 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created by https://www.toptal.com/developers/gitignore/api/android,androidstudio,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=android,androidstudio,macos

# Gradle files
.gradle/
build/
Expand Down Expand Up @@ -26,8 +29,168 @@ render.experimental.xml
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json

# Android Profiling
*.hprof

### Android Patch ###
gen-external-apklibs

# Replacement of .externalNativeBuild directories introduced
# with Android Studio 3.5.

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### AndroidStudio ###
# Covers files to be ignored for android development using Android Studio.

# Built application files
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle

# Signing files
.signing/

# Local configuration file (sdk path, etc)

# Proguard folder generated by Eclipse
proguard/

# Log Files

# Android Studio
/*/build/
/*/local.properties
/*/out
/*/*/build
/*/*/production
.navigation/
*.ipr
*~
*.swp

# Keystore files

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Android Patch

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# NDK
obj/

# IntelliJ IDEA
*.iws
/out/

# User-specific configurations
.idea/caches/
.idea/libraries/
.idea/shelf/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/datasources.xml
.idea/dataSources.ids
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/assetWizardSettings.xml
.idea/gradle.xml
.idea/jarRepositories.xml
.idea/navEditor.xml

# Legacy Eclipse project files
.classpath
.project
.cproject
.settings/

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear

# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
hs_err_pid*

## Plugin-specific files:

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Mongo Explorer plugin
.idea/mongoSettings.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### AndroidStudio Patch ###

!/gradle/wrapper/gradle-wrapper.jar

# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio,macos
9 changes: 7 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ plugins {
id(app.Plugins.ANDROID_APPLICATION)
id(app.Plugins.KOTLIN_ANDROID)
id(app.Plugins.KOTLIN_KAPT)
id(app.Plugins.GOOGLE_SERVICE)
id(app.Plugins.FIREBASE_CRASHLYTICS)
id(app.Plugins.HILT_ANDROID)
}

android {
namespace = "com.yapp.growth"
compileSdk = Configs.COMPILE_SDK

defaultConfig {
applicationId = "com.yapp.growth"
applicationId = Configs.APPLICATION_ID
minSdk = Configs.MIN_SDK
targetSdk = Configs.TARGET_SDK
versionCode = Configs.VERSION_CODE
Expand Down Expand Up @@ -47,4 +48,8 @@ dependencies {
app.ModuleDependencies.hilt.implement(this)
app.ModuleDependencies.hiltAndroid.implement(this)
app.ModuleDependencies.timber.implement(this)

implementation(platform(app.ModuleDependencies.FIREBASE_BOM))
implementation(app.ModuleDependencies.FIREBASE_ANALYTICS)
implementation(app.ModuleDependencies.FIREBASE_CRASHLYTICS)
Comment on lines +52 to +54
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 BOM으로 넣어주는 경우 버전 정보도 없고 platform으로 넣어주는 게 DependencyInfo 쪽에 없어서 그냥 이렇게 넣어줬는데 방법이 있을까요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

platform 이라는 워딩이 있긴 한데.. 어떻게 쓰는건지를 모르겠네요 저도 더 시도해볼게요

}
39 changes: 39 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "626079185695",
"project_id": "planz-82728",
"storage_bucket": "planz-82728.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:626079185695:android:a0c32837fa7d87257cce2a",
"android_client_info": {
"package_name": "com.yapp.growth"
}
},
"oauth_client": [
{
"client_id": "626079185695-j6kgiofc8h8tqh8gu8talv5c1soq866s.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAyx8MnwBiLESMNMhh0yARVCWxWkBiIs9U"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "626079185695-j6kgiofc8h8tqh8gu8talv5c1soq866s.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.Growth">
<activity
android:name=".ui.MainActivity"
android:name=".presentation.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Growth">
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ buildscript {
classpath(ProjectDependencies.ANDROID_BUILD_TOOL)
classpath(ProjectDependencies.KOTLIN_GRADLE_PLUGIN)
classpath(ProjectDependencies.HILT_GRADLE_PLUGIN)
classpath(ProjectDependencies.FIREBASE_CRASHLYTICS)
classpath(ProjectDependencies.GOOGLE_SERVICE)
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Configs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ object Configs {
const val COMPILE_SDK = 32

//Android Default Config
const val APPLICATION_ID = "com.yapp.growth"
const val MIN_SDK = 26
const val TARGET_SDK = 32
const val VERSION_CODE = 1
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/java/ProjectDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ object ProjectDependencies {
const val ANDROID_BUILD_TOOL = "com.android.tools.build:gradle:${Versions.ANDROID_BUILD_TOOL}"
const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}"
const val HILT_GRADLE_PLUGIN = "com.google.dagger:hilt-android-gradle-plugin:${Versions.HILT}"
const val GOOGLE_SERVICE = "com.google.gms:google-services:${Versions.GOOGLE_SERVICE}"
const val FIREBASE_CRASHLYTICS = "com.google.firebase:firebase-crashlytics-gradle:${Versions.FIREBASE_CRASHLYTICS}"
}
22 changes: 13 additions & 9 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
// alphabet 순서대로 정렬
object Versions {
const val ANDROID_APP_COMPAT = "1.4.1"
const val ANDROID_BUILD_TOOL = "7.2.0"
const val ANDROID_CORE = "1.7.0"
const val KOTLIN = "1.6.10"
const val COMPOSE = "1.1.1"
const val ACTIVITY_COMPOSE = "1.4.0"
const val ANDROID_APP_COMPAT = "1.4.1"
const val CONSTRAINT_LAYOUT = "2.1.3"
const val COIL = "1.4.0"
const val LIFECYCLE = "2.4.1"
const val COMPOSE = "1.2.0-alpha08"
const val COMPOSE_ACTIVITY = "1.4.0"
const val CONSTRAINT_LAYOUT = "2.1.3"
const val FIREBASE_BOM = "29.1.0"
const val FIREBASE_CRASHLYTICS = "2.9.0"
const val GOOGLE_SERVICE = "4.3.10"
const val HILT = "2.42"
const val HILT_ANDROID = "1.0.0-beta01"
const val JUNIT = "4.13.2"
const val KOTLIN = "1.6.20"
const val KOTLIN_COROUTINES = "1.5.1"
const val RETROFIT = "2.7.1"
const val LIFECYCLE = "2.4.1"
const val OKHTTP = "4.3.1"
const val HILT = "2.42"
const val HILT_ANDROID = "1.0.0-beta01"
const val RETROFIT = "2.7.1"
const val TIMBER = "5.0.1"
}
8 changes: 6 additions & 2 deletions buildSrc/src/main/java/app/ModuleDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object ModuleDependencies {
),
DependencyInfo(
"androidx.activity:activity-compose",
Versions.ACTIVITY_COMPOSE,
Versions.COMPOSE_ACTIVITY,
Method.IMPLEMENTATION
),
DependencyInfo("io.coil-kt:coil-compose", Versions.COIL, Method.IMPLEMENTATION)
Expand Down Expand Up @@ -121,8 +121,12 @@ object ModuleDependencies {
Method.IMPLEMENTATION
),
)

val timber = arrayOf(
DependencyInfo("com.jakewharton.timber:timber", Versions.TIMBER, Method.IMPLEMENTATION)
)

const val FIREBASE_BOM = "com.google.firebase:firebase-bom:${Versions.FIREBASE_BOM}"
const val FIREBASE_ANALYTICS = "com.google.firebase:firebase-analytics-ktx"
const val FIREBASE_CRASHLYTICS = "com.google.firebase:firebase-crashlytics-ktx"
Comment on lines +129 to +131
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요기도 마찬가지로 같은 이유로 그냥 상수값으로 넣어놨는데 다른 좋은 방법이 있을지,, 의견 여쭤봅니다! ㅠ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 시도해봤는데 따로 넣으려면 아무래도 메소드같은걸 몇 개 더 추가해야 할 것 같은데..
개인적으로는 필요하지 않은 비용? 같기도 해서 나중에 이런 케이스가 한번 더 나오게 되면 그 때 추가하는게 맞는 것 같아용!
지금은 이대로 가도 괜찮을 것 같다는게 제 생각임니다

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jihee-dev @hoyahozz
버전없는 Data Class 만들어서 따로 주입해보기 해봤는데..

image

image

어림없네요 ㅋㅋㅋㅋㅋ
더 찾아봐야 할 것 같아요 방법이 있는지

일단 이렇게 가고 정호님 말씀대로 더 추가하게 되면 바꿔보죠
고생하셨습니다!
👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋㅋㅋㅋㅋ 넴 빌드 실패한 거 수정해서 머지할게용

}
2 changes: 2 additions & 0 deletions buildSrc/src/main/java/app/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ object Plugins {
const val KOTLIN_ANDROID = "kotlin-android"
const val KOTLIN_KAPT = "kotlin-kapt"
const val KOTLIN_PARCELIZE = "kotlin-parcelize"
const val GOOGLE_SERVICE = "com.google.gms.google-services"
const val FIREBASE_CRASHLYTICS = "com.google.firebase.crashlytics"
const val HILT_ANDROID = "dagger.hilt.android.plugin"
}
4 changes: 4 additions & 0 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ dependencies {
app.ModuleDependencies.okhttp.implement(this)
app.ModuleDependencies.hilt.implement(this)
app.ModuleDependencies.timber.implement(this)

implementation(platform(app.ModuleDependencies.FIREBASE_BOM))
implementation(app.ModuleDependencies.FIREBASE_ANALYTICS)
implementation(app.ModuleDependencies.FIREBASE_CRASHLYTICS)
}
7 changes: 6 additions & 1 deletion presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ plugins {
id(app.Plugins.KOTLIN_ANDROID)
id(app.Plugins.KOTLIN_PARCELIZE)
id(app.Plugins.KOTLIN_KAPT)
id(app.Plugins.GOOGLE_SERVICE)
id(app.Plugins.FIREBASE_CRASHLYTICS)
id(app.Plugins.HILT_ANDROID)
}

android {
namespace = "com.yapp.presentation"
compileSdk = Configs.COMPILE_SDK

defaultConfig {
Expand Down Expand Up @@ -42,4 +43,8 @@ dependencies {
app.ModuleDependencies.hilt.implement(this)
app.ModuleDependencies.hiltAndroid.implement(this)
app.ModuleDependencies.timber.implement(this)

implementation(platform(app.ModuleDependencies.FIREBASE_BOM))
implementation(app.ModuleDependencies.FIREBASE_ANALYTICS)
implementation(app.ModuleDependencies.FIREBASE_CRASHLYTICS)
}
Loading