Skip to content
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
7 changes: 6 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ android {
resValue("string", "app_name", "GAMSS Dev")
}
getByName("release") {
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
if (hasCompleteReleaseSigningConfig) {
signingConfig = signingConfigs.getByName("release")
}
Expand Down
12 changes: 12 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Crashlytics 스택트레이스를 mapping 으로 복원하려면 줄 번호가 남아 있어야 한다.
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile

# WorkManager 가 끌어오는 Room 2.6 이하의 consumer rule 은 생성자를 지정하지 않아
# R8 full mode 에서 WorkDatabase_Impl.<init>() 이 제거된다. Room 2.7 이상으로 오르면 지워도 된다.
-keep class * extends androidx.room.RoomDatabase { <init>(); }

# onnxruntime 은 consumer rule 이 없고 LiteRT 는 @UsedByReflection 만 유지해서,
# JNI 가 이름으로 찾는 패키지 전체를 keep 한다.
-keep class ai.onnxruntime.** { *; }
-keep class org.tensorflow.lite.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import com.gamss.android.domain.safety.RiskTerm
import com.gamss.android.domain.summary.SummarizeDiaryUseCase
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.setMain
Expand Down Expand Up @@ -123,10 +123,12 @@ class ChatRoomLoadTest {
pendingReveal = reveal,
riskLexiconRepository = warningLexiconRepository,
)
// 한 runTest 에서 test 블록을 쓰고 나면 다음 test 블록의 intent 가 실행되지 않아 첫 진입은 실제 컨테이너로 둔다.
// 실제 컨테이너는 Dispatchers.Default 에서 처리되어 advanceUntilIdle 로는 기다릴 수 없다.
firstVisit.start(ROOM_ID)
advanceUntilIdle()
val afterFirstVisit = firstVisit.container.stateFlow.first { it.conversationId == ROOM_ID && !it.isLoading }
// 첫 진입은 pending 경로로 들어와 방금 보낸 메시지만 보인다.
assertEquals(listOf(USER_ID), firstVisit.container.stateFlow.value.messages.map { it.id })
assertEquals(listOf(USER_ID), afterFirstVisit.messages.map { it.id })

chatRoomViewModel(
conversationRepository = repository,
Expand Down
Loading