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

구글 로그인 구현 및 Hilt 작업 #7

Merged
merged 8 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-android-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
echo MISSION_MATE_BASE_URL=\"$MISSION_MATE_BASE_URL\" >> ./local.properties

- name: Build with Gradle
run: fastlane beta
run: fastlane test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ build/

# Local configuration file (sdk path, etc)
local.properties
keystore.properties

# Proguard folder generated by Eclipse
proguard/
Expand Down Expand Up @@ -164,4 +165,5 @@ google-services.json


# End of https://www.gitignore.io/api/kotlin,androidstudio
/app/keystore
/app/keystore
/app/mission-mate-keystore.jks
24 changes: 22 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
Expand All @@ -7,6 +9,10 @@ plugins {
alias(libs.plugins.kotlin.ksp)
}

//val keystorePropertiesFile = rootProject.file("keystore.properties")
//val keystoreProperties = Properties()
//keystoreProperties.load(FileInputStream(keystorePropertiesFile))

android {
namespace = "com.goalpanzi.mission_mate"
compileSdk = 34
Expand All @@ -24,15 +30,28 @@ android {
}
}

// signingConfigs {
// create("release") {
// keyAlias = keystoreProperties["keyAlias"] as String
// keyPassword = keystoreProperties["keyPassword"] as String
// storeFile = file(keystoreProperties["storeFile"] as String)
// storePassword = keystoreProperties["storePassword"] as String
// }
// }

buildTypes {
release {
isMinifyEnabled = false
getByName("debug")
// signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
buildFeatures {
buildConfig = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand All @@ -57,4 +76,5 @@ dependencies {
implementation(project(":feature:main"))
implementation(project(":feature:login"))
implementation(project(":core:designsystem"))
}
implementation(project(":core:data"))
}
10 changes: 9 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class * { *; }
-keep interface * { *; }

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }
6 changes: 4 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MainApplication"
android:allowBackup="true"
Expand All @@ -12,7 +14,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Missionmate"
tools:targetApi="31">
</application>
android:networkSecurityConfig="@xml/network_security_config"
tools:targetApi="31"/>

</manifest>
6 changes: 6 additions & 0 deletions app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">223.130.130.31</domain>
</domain-config>
</network-security-config>
6 changes: 4 additions & 2 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ android {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -45,4 +43,8 @@ dependencies {

ksp(libs.hilt.compiler)
implementation(libs.hilt.android)

implementation(project(":core:domain"))
implementation(project(":core:model"))
implementation(project(":core:network"))
}
Empty file removed core/data/consumer-rules.pro
Empty file.
10 changes: 9 additions & 1 deletion core/data/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class * { *; }
-keep interface * { *; }

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.goalpanzi.mission_mate.core.data.di

import com.goalpanzi.mission_mate.core.data.repository.LoginRepositoryImpl
import com.goalpanzi.mission_mate.core.domain.repository.LoginRepository
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent

@Module
@InstallIn(SingletonComponent::class)
internal abstract class DataModule {

@Binds
abstract fun bindLoginRepository(impl: LoginRepositoryImpl): LoginRepository
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.goalpanzi.mission_mate.core.data.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import javax.inject.Qualifier

@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class Dispatcher(val dispatchers: MissionMateDispatcher)

enum class MissionMateDispatcher {
IO
}

@Module
@InstallIn(SingletonComponent::class)
interface DispatchersModule {

@Provides
@Dispatcher(MissionMateDispatcher.IO)
fun providesIODispatcher(): CoroutineDispatcher = Dispatchers.IO

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.goalpanzi.mission_mate.core.data.repository

import com.goalpanzi.mission_mate.core.domain.repository.LoginRepository
import com.goalpanzi.mission_mate.core.network.service.LoginService
import com.luckyoct.core.model.GoogleLogin
import com.luckyoct.core.model.request.GoogleLoginRequest
import javax.inject.Inject

class LoginRepositoryImpl @Inject constructor(
private val loginService: LoginService
): LoginRepository {

override suspend fun requestGoogleLogin(token: String, email: String): GoogleLogin {
val request = GoogleLoginRequest(identityToken = token, email = email)
val response = loginService.requestGoogleLogin(request)
return response
}
}
2 changes: 0 additions & 2 deletions core/datastore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ android {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
Empty file removed core/datastore/consumer-rules.pro
Empty file.
10 changes: 9 additions & 1 deletion core/datastore/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class * { *; }
-keep interface * { *; }

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }

This file was deleted.

2 changes: 0 additions & 2 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ android {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
Empty file.
10 changes: 9 additions & 1 deletion core/designsystem/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class * { *; }
-keep interface * { *; }

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ val Pink80 = Color(0xFFEFB8C8)

val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
val Pink40 = Color(0xFF7D5260)

val Orange01 = Color(0xFFF5EDEA)
4 changes: 2 additions & 2 deletions core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ android {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -45,4 +43,6 @@ dependencies {

ksp(libs.hilt.compiler)
implementation(libs.hilt.android)

implementation(project(":core:model"))
}
Empty file removed core/domain/consumer-rules.pro
Empty file.
10 changes: 9 additions & 1 deletion core/domain/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class * { *; }
-keep interface * { *; }

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }
Loading
Loading