Skip to content

Commit

Permalink
Merge branch 'dev' into feat/#113
Browse files Browse the repository at this point in the history
  • Loading branch information
BGuga committed Aug 17, 2023
2 parents 0cfc5e4 + 3a6ae1b commit d23932a
Show file tree
Hide file tree
Showing 219 changed files with 3,028 additions and 1,303 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/cd-back-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CD-Back-Dev

on:
push:
branches:
- dev
paths: 'backend/**'

workflow_dispatch:

defaults:
run:
working-directory: backend

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 리포지토리 체크아웃
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN }}

- name: 자바 설치
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'

- name: gradlew 권한 부여
run: chmod +x gradlew

- name: Gradle Test
run: ./gradlew test

- name: trigger to jenkins dev cd
uses: appleboy/jenkins-action@master
with:
url: ${{ secrets.JENKINS_URL }}
user: "festago"
token: ${{ secrets.JENKINS_API_TOKEN}}
job: "festago-dev-cd"
7 changes: 3 additions & 4 deletions .github/workflows/ci-back.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI-Back

on:
push:
branches:
- dev
paths: 'backend/**'
pull_request:
branches:
- dev
Expand All @@ -20,6 +16,9 @@ jobs:
steps:
- name: 리포지토리 체크아웃
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN }}

- name: 자바 설치
uses: actions/setup-java@v3
Expand Down
1 change: 1 addition & 0 deletions android/festago/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions android/festago/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId = "com.festago.festago"
minSdk = 28
targetSdk = 33
versionCode = 2
versionName = "1.0.0"
versionCode = 3
versionName = "1.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -35,7 +35,8 @@ android {

buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
Expand Down Expand Up @@ -135,6 +136,9 @@ dependencies {

// Encrypted SharedPreference
implementation("androidx.security:security-crypto-ktx:1.1.0-alpha06")

// domain
implementation(project(":domain"))
}

fun getSecretKey(propertyKey: String): String {
Expand Down
63 changes: 63 additions & 0 deletions android/festago/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,66 @@

# https://developers.kakao.com/docs/latest/en/getting-started/sdk-android#configure-for-shrinking-and-obfuscation-(optional)
-keep class com.kakao.sdk.**.model.* { <fields>; }

#---------------------------------------- Retrofit
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
-keepattributes Signature, InnerClasses, EnclosingMethod

# Retrofit does reflection on method and parameter annotations.
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations

# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
-keepattributes AnnotationDefault

# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}

# Ignore annotation used for build tooling.
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

# Ignore JSR 305 annotations for embedding nullability information.
-dontwarn javax.annotation.**

# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit

# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*

# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>

# Keep inherited services.
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * extends <1>

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# R8 full mode strips generic signatures from return types if not kept.
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# With R8 full mode generic signatures are stripped for classes that are not kept.
-keep,allowobfuscation,allowshrinking class retrofit2.Response

#---------------------------------------- Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
<init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
*** rewind();
}
Binary file modified android/festago/app/src/main/ic_festago_logo-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,57 @@ package com.festago.festago

import android.app.Application
import com.festago.festago.analytics.FirebaseAnalyticsHelper
import com.festago.festago.data.datasource.AuthLocalDataSource
import com.festago.festago.data.retrofit.AuthRetrofitClient
import com.festago.festago.data.retrofit.NormalRetrofitClient
import com.festago.festago.di.AnalysisContainer
import com.festago.festago.di.AuthServiceContainer
import com.festago.festago.di.LocalDataSourceContainer
import com.festago.festago.di.NormalServiceContainer
import com.festago.festago.di.RepositoryContainer
import com.festago.festago.di.TokenContainer
import com.kakao.sdk.common.KakaoSdk

class FestagoApplication : Application() {

override fun onCreate() {
super.onCreate()
FirebaseAnalyticsHelper.init(applicationContext)
initKakaoSdk()
initRepositoryContainer()
initFirebaseContainer()
}

private fun initKakaoSdk() {
KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY)
initRetrofit()
}

private fun initRetrofit() {
val authLocalDataSource = AuthLocalDataSource.getInstance(applicationContext)
NormalRetrofitClient.init(BuildConfig.BASE_URL)
AuthRetrofitClient.init(BuildConfig.BASE_URL) {
authLocalDataSource.token ?: NULL_TOKEN
}
private fun initRepositoryContainer() {
normalServiceContainer = NormalServiceContainer(BuildConfig.BASE_URL)

tokenContainer = TokenContainer(
normalServiceContainer = normalServiceContainer,
localDataSourceContainer = LocalDataSourceContainer(applicationContext),
)

authServiceContainer = AuthServiceContainer(
baseUrl = BuildConfig.BASE_URL,
tokenContainer = tokenContainer,
)

repositoryContainer = RepositoryContainer(
authServiceContainer = authServiceContainer,
normalServiceContainer = normalServiceContainer,
tokenContainer = tokenContainer,
)
}

private fun initFirebaseContainer() {
FirebaseAnalyticsHelper.init(applicationContext)
analysisContainer = AnalysisContainer()
}

companion object {
private const val NULL_TOKEN = "null"
companion object DependencyContainer {
lateinit var normalServiceContainer: NormalServiceContainer
lateinit var authServiceContainer: AuthServiceContainer
lateinit var repositoryContainer: RepositoryContainer
lateinit var analysisContainer: AnalysisContainer
lateinit var tokenContainer: TokenContainer
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.festago.festago.data.datasource

interface AuthDataSource {
interface TokenDataSource {
var token: String?
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import android.content.SharedPreferences
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey

class AuthLocalDataSource private constructor(
context: Context,
) : AuthDataSource {
class TokenLocalDataSource(context: Context) : TokenDataSource {

private val sharedPreference: SharedPreferences by lazy {
val masterKeyAlias = MasterKey
Expand All @@ -27,13 +25,5 @@ class AuthLocalDataSource private constructor(
companion object {
private const val ENCRYPTED_PREF_FILE = "encrypted_pref_file"
private const val TOKEN_KEY = "TOKEN_KEY"

private var INSTANCE: AuthLocalDataSource? = null

@Synchronized
fun getInstance(context: Context): AuthLocalDataSource {
return INSTANCE ?: AuthLocalDataSource(context.applicationContext)
.also { INSTANCE = it }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.Festival
import com.festago.festago.model.Festival
import kotlinx.serialization.Serializable
import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.Festival
import com.festago.festago.model.Festival
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.MemberTicketFestival
import com.festago.festago.model.MemberTicketFestival
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.Ticket
import com.festago.festago.domain.model.TicketCondition
import com.festago.festago.model.Ticket
import com.festago.festago.model.TicketCondition
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.LocalDateTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.Ticket
import com.festago.festago.model.Ticket
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.Reservation
import com.festago.festago.model.Reservation
import kotlinx.serialization.Serializable
import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.ReservationStage
import com.festago.festago.model.ReservationStage
import kotlinx.serialization.Serializable
import java.time.LocalDateTime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.ReservationTicket
import com.festago.festago.model.ReservationTicket
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.ReservationTicket
import com.festago.festago.model.ReservationTicket
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.ReservedTicket
import com.festago.festago.model.ReservedTicket
import kotlinx.serialization.Serializable
import java.time.LocalDateTime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.Stage
import com.festago.festago.model.Stage
import kotlinx.serialization.Serializable
import java.time.LocalDateTime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.TicketCode
import com.festago.festago.model.TicketCode
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.festago.data.dto

import com.festago.festago.domain.model.UserProfile
import com.festago.festago.model.UserProfile
import kotlinx.serialization.Serializable

@Serializable
Expand Down
Loading

0 comments on commit d23932a

Please sign in to comment.