Skip to content

Commit

Permalink
cd build setting (#120)
Browse files Browse the repository at this point in the history
* ruby 세팅 수정 (#93)

* ruby 세팅 수정 (#95)

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update Gemfile.lock

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update android-cd.yml

* Update build.gradle.kts

* Update build.gradle.kts

* Update build.gradle.kts

* Update build.gradle.kts

* Update build.gradle.kts

* Update build.gradle.kts

* Update build.gradle.kts

* Update build.gradle.kts

* api request 가 특정 시점 이후 호출되지 않는 이슈 해결 (#117)

* uiState 변경 방식 update 로 통일

* TODO 제거

이거 예전에 지웠는데 왜 남아있지

* Ktor 를 Retrofit 으로 migration

* GuestLogin 관련 함수를 BandalartService 내에서 분리

GuestLoginService interface 로 따로 선언

* style check success

* 사용하지 않는 클래스 주석처리

* GuestLoginService Provider 추가

* KtorClient, RetrofitClient 를 별도의 networkModule 로 분리

networkModule 을 생성함에 따라 모듈의 순환 구조를 방지하기 위해 datastore 모듈 추가

* style check success

* style check success

* fix run build fail

* 스플래시 뷰모델 api 호출 이후 0.5 초 이내에 응답을 받을 경우 Loading Screen 을 띄우지 않는 로직 적용

update 로 uiState 변경 로직 통일

* chore: 코드 정리

viewModel 에서 수집한 error 는 이미 toAlertMessage 함수에 의해 custom 된 exception message 이므로 로그를 확인할 필요가 없으므로 제거

* 하드코딩된 텍스트 stringResource 로 변경

* Update android-cd.yml

---------

Co-authored-by: JI HUN LEE <[email protected]>
  • Loading branch information
likppi10 and easyhooon authored Aug 30, 2023
1 parent 4d51bee commit c2d6928
Show file tree
Hide file tree
Showing 33 changed files with 784 additions and 445 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/android-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,20 @@ jobs:
run: |
echo "SERVER_BASE_URL=${{ secrets.SERVER_BASE_URL }}" >> secrets.properties
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: '/app/bandalart.jks'
encodedString: ${{secrets.APP_RELEASE_KEY_STORE_BASE_64}}

# - name: Decode Keystore
# id: decode_keystore
# uses: timheuer/base64-to-file@v1
# with:
# fileName: '/app/bandalart.jks'
# encodedString: ${{secrets.APP_RELEASE_KEY_STORE_BASE_64}}

- name: Generate Keystore file from Github Secrets
run: |
echo "$KEYSTORE" > ./app/bandalart.b64
base64 -d -i ./app/bandalart.b64 > ./app/bandalart.jks
env:
KEYSTORE: ${{ secrets.APP_RELEASE_KEY_STORE_BASE_64 }}

- name: Generate keystore.properties
run: |
echo "STORE_FILE=${{ secrets.STORE_FILE }}" >> keystore.properties
Expand Down
6 changes: 6 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ android {

buildTypes {
getByName("debug") {
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-debug.pro"
)
applicationIdSuffix = ".dev"
manifestPlaceholders += mapOf(
"appName" to "@string/app_name_dev"
Expand Down Expand Up @@ -59,8 +63,10 @@ dependencies {
coreLibraryDesugaring(libs.desugar.jdk)
implementations(
projects.core.data,
projects.core.datastore,
projects.core.designsystem,
projects.core.domain,
projects.core.network,
projects.core.ui,
projects.feature.complete,
projects.feature.home,
Expand Down
9 changes: 9 additions & 0 deletions app/proguard-debug.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
-dontobfuscate #난독화를 수행하지 않도록 함
-keepattributes SoureFile,LineNumberTable #소스파일, 라인 정보 유지
# End: Debug ProGuard rules

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# 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
9 changes: 9 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# 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
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ tasks.register("clean", type = Delete::class) {
}

tasks.register("bundleRelease", type = Exec::class) {
commandLine(project.rootDir.resolve("gradlew"), "bundle")
workingDir = project.rootDir
commandLine(project.rootDir.resolve("gradlew"), "bundle")
workingDir = project.rootDir

}

tasks.register("release") {
Expand Down
9 changes: 4 additions & 5 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
bandalart("android-library")
bandalart("android-hilt")
alias(libs.plugins.google.secrets)
alias(libs.plugins.kotlinx.serialization)
}

Expand All @@ -20,9 +19,13 @@ android {
dependencies {
implementations(
projects.core.domain,
projects.core.datastore,
projects.core.network,
libs.kotlinx.serialization.json,
libs.androidx.datastore.preferences,
libs.bundles.ktor.client,
libs.bundles.retrofit,
libs.bundles.okhttp,
libs.timber,
)
}
Expand All @@ -32,7 +35,3 @@ tasks.withType<KotlinCompile> {
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=kotlin.ExperimentalStdlibApi")
}
}

secrets {
defaultPropertiesFileName = "secrets.properties"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package com.nexters.bandalart.android.core.data.di

import com.nexters.bandalart.android.core.data.repository.BandalartRepositoryImpl
import com.nexters.bandalart.android.core.data.repository.GuestLoginTokenRepositoryImpl
import com.nexters.bandalart.android.core.data.repository.ServerHealthCheckRepositoryImpl
import com.nexters.bandalart.android.core.domain.repository.BandalartRepository
import com.nexters.bandalart.android.core.domain.repository.GuestLoginTokenRepository
import com.nexters.bandalart.android.core.domain.repository.ServerHealthCheckRepository
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
Expand All @@ -22,11 +20,11 @@ internal abstract class RepositoryModule {
guestLoginTokenRepositoryImpl: GuestLoginTokenRepositoryImpl,
): GuestLoginTokenRepository

@Binds
@Singleton
abstract fun bindServerHealthCheckRepository(
serverHealthCheckRepositoryImpl: ServerHealthCheckRepositoryImpl,
): ServerHealthCheckRepository
// @Binds
// @Singleton
// abstract fun bindServerHealthCheckRepository(
// serverHealthCheckRepositoryImpl: ServerHealthCheckRepositoryImpl,
// ): ServerHealthCheckRepository

@Binds
@Singleton
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.nexters.bandalart.android.core.data.di

import com.nexters.bandalart.android.core.data.service.BandalartService
import com.nexters.bandalart.android.core.data.service.GuestLoginService
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
import retrofit2.Retrofit

@Module
@InstallIn(SingletonComponent::class)
internal object ServiceModule {

@Singleton
@Provides
internal fun provideBandalartService(retrofit: Retrofit): BandalartService {
return retrofit.create(BandalartService::class.java)
}

@Singleton
@Provides
internal fun provideGuestLoginService(retrofit: Retrofit): GuestLoginService {
return retrofit.create(GuestLoginService::class.java)
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nexters.bandalart.android.core.data.local.datasource

import com.nexters.bandalart.android.core.data.datasource.CompletedBandalartKeyDataSource
import com.nexters.bandalart.android.core.data.local.DataStoreProvider
import com.nexters.bandalart.android.core.datastore.DataStoreProvider
import javax.inject.Inject

internal class CompletedBandalartKeyDataStoreImpl @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nexters.bandalart.android.core.data.local.datasource

import com.nexters.bandalart.android.core.data.datasource.GuestLoginLocalDataSource
import com.nexters.bandalart.android.core.data.local.DataStoreProvider
import com.nexters.bandalart.android.core.datastore.DataStoreProvider
import javax.inject.Inject

internal class GuestLoginLocalDataSourceImpl @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nexters.bandalart.android.core.data.local.datasource

import com.nexters.bandalart.android.core.data.datasource.RecentBandalartKeyDataSource
import com.nexters.bandalart.android.core.data.local.DataStoreProvider
import com.nexters.bandalart.android.core.datastore.DataStoreProvider
import javax.inject.Inject

internal class RecentBandalartKeyDataSourceImpl @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,65 @@ import com.nexters.bandalart.android.core.data.model.bandalart.UpdateBandalartEm
import com.nexters.bandalart.android.core.data.model.bandalart.UpdateBandalartMainCellRequest
import com.nexters.bandalart.android.core.data.model.bandalart.UpdateBandalartSubCellRequest
import com.nexters.bandalart.android.core.data.model.bandalart.UpdateBandalartTaskCellRequest
import com.nexters.bandalart.android.core.data.service.BandalartService
import com.nexters.bandalart.android.core.data.util.extension.safeRequest
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.request.delete
import io.ktor.client.request.get
import io.ktor.client.request.patch
import io.ktor.client.request.post
import io.ktor.client.request.setBody
import javax.inject.Inject

internal class BandalartRemoteDataSourceImpl @Inject constructor(
private val client: HttpClient,
// private val client: HttpClient,
private val service: BandalartService,
) : BandalartRemoteDataSource {
override suspend fun createBandalart(): BandalartResponse? {
return client.safeRequest {
post("v1/bandalarts").body()
// return client.safeRequest {
// post("v1/bandalarts").body()
// }
return safeRequest {
service.createBandalart()
}
}

override suspend fun getBandalartList(): List<BandalartDetailResponse>? {
return client.safeRequest {
get("v1/bandalarts").body()
// return client.safeRequest {
// get("v1/bandalarts").body()
// }
return safeRequest {
service.getBandalartList()
}
}

override suspend fun getBandalartDetail(bandalartKey: String): BandalartDetailResponse? {
return client.safeRequest {
get("v1/bandalarts/$bandalartKey").body()
// return client.safeRequest {
// get("v1/bandalarts/$bandalartKey").body()
// }
return safeRequest {
service.getBandalartDetail(bandalartKey)
}
}

override suspend fun deleteBandalart(bandalartKey: String) {
client.safeRequest {
delete("v1/bandalarts/$bandalartKey")
// client.safeRequest {
// delete("v1/bandalarts/$bandalartKey")
// }
safeRequest {
service.deleteBandalart(bandalartKey)
}
}

override suspend fun getBandalartMainCell(bandalartKey: String): BandalartCellResponse? {
return client.safeRequest {
get("v1/bandalarts/$bandalartKey/cells").body()
// return client.safeRequest {
// get("v1/bandalarts/$bandalartKey/cells").body()
// }
return safeRequest {
service.getBandalartMainCell(bandalartKey)
}
}

override suspend fun getBandalartCell(bandalartKey: String, cellKey: String): BandalartCellResponse? {
return client.safeRequest {
get("v1/bandalarts/$bandalartKey/cells/$cellKey").body()
// return client.safeRequest {
// get("v1/bandalarts/$bandalartKey/cells/$cellKey").body()
// }
return safeRequest {
service.getBandalartCell(bandalartKey, cellKey)
}
}

Expand All @@ -63,10 +76,13 @@ internal class BandalartRemoteDataSourceImpl @Inject constructor(
cellKey: String,
updateBandalartMainCellRequest: UpdateBandalartMainCellRequest,
) {
client.safeRequest {
patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
setBody(updateBandalartMainCellRequest)
}
// client.safeRequest {
// patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
// setBody(updateBandalartMainCellRequest)
// }
// }
safeRequest {
service.updateBandalartMainCell(bandalartKey, cellKey, updateBandalartMainCellRequest)
}
}

Expand All @@ -75,10 +91,13 @@ internal class BandalartRemoteDataSourceImpl @Inject constructor(
cellKey: String,
updateBandalartSubCellRequest: UpdateBandalartSubCellRequest,
) {
client.safeRequest {
patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
setBody(updateBandalartSubCellRequest)
}
// client.safeRequest {
// patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
// setBody(updateBandalartSubCellRequest)
// }
// }
safeRequest {
service.updateBandalartSubCell(bandalartKey, cellKey, updateBandalartSubCellRequest)
}
}

Expand All @@ -87,10 +106,13 @@ internal class BandalartRemoteDataSourceImpl @Inject constructor(
cellKey: String,
updateBandalartTaskCellRequest: UpdateBandalartTaskCellRequest,
) {
client.safeRequest {
patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
setBody(updateBandalartTaskCellRequest)
}
// client.safeRequest {
// patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
// setBody(updateBandalartTaskCellRequest)
// }
// }
safeRequest {
service.updateBandalartTaskCell(bandalartKey, cellKey, updateBandalartTaskCellRequest)
}
}

Expand All @@ -99,22 +121,31 @@ internal class BandalartRemoteDataSourceImpl @Inject constructor(
cellKey: String,
updateBandalartEmojiRequest: UpdateBandalartEmojiRequest,
) {
client.safeRequest {
patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
setBody(updateBandalartEmojiRequest)
}
// client.safeRequest {
// patch("v1/bandalarts/$bandalartKey/cells/$cellKey") {
// setBody(updateBandalartEmojiRequest)
// }
// }
safeRequest {
service.updateBandalartEmoji(bandalartKey, cellKey, updateBandalartEmojiRequest)
}
}

override suspend fun deleteBandalartCell(bandalartKey: String, cellKey: String) {
client.safeRequest {
delete("v1/bandalarts/$bandalartKey/cells/$cellKey")
// client.safeRequest {
// delete("v1/bandalarts/$bandalartKey/cells/$cellKey")
// }
safeRequest {
service.deleteBandalartCell(bandalartKey, cellKey)
}
}

override suspend fun shareBandalart(bandalartKey: String): BandalartShareResponse? {
return client.safeRequest {
post("v1/bandalarts/$bandalartKey/shares").body()
// return client.safeRequest {
// post("v1/bandalarts/$bandalartKey/shares").body()
// }
return safeRequest {
service.shareBandalart(bandalartKey)
}
}
}
Loading

0 comments on commit c2d6928

Please sign in to comment.