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
146 changes: 146 additions & 0 deletions .github/workflows/localization-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Localization Validation

on:
push:
branches:
- feature/firebase-remote-localization
pull_request:
branches:
- develop
workflow_dispatch:

concurrency:
group: localization-validation-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'

- name: Make Gradle wrapper executable
run: chmod +x gradlew

- name: Verify localization architecture
shell: bash
run: |
if grep -R --line-number --include='*.kt' 'Res\.string' app core data domain infrastructure model ui; then
echo 'Found remaining Compose Res.string usage.'
exit 1
fi
if grep -R --line-number --include='*.kt' 'org\.jetbrains\.compose\.resources\.stringResource' app core data domain infrastructure model ui; then
echo 'Found remaining JetBrains Compose stringResource import.'
exit 1
fi
if grep -R --line-number --include='*.kt' 'com\.google\.firebase' data/localization; then
echo 'Localization data code must use Firebase-KMP-Kit.'
exit 1
fi
if ! grep -R --line-number --include='*.kt' 'com\.firebasekit\.remoteconfig' data/localization/src/commonMain; then
echo 'Firebase-KMP-Kit Remote Config must be used from commonMain.'
exit 1
fi
if grep -R --line-number --include='*.kt' 'dev\.gitlive\.firebase' data/localization; then
echo 'Found obsolete GitLive localization integration.'
exit 1
fi
if [ -d data/firebase ]; then
echo 'Obsolete data/firebase module still exists.'
exit 1
fi
if find data/localization/src -type f -name '*.kt' | grep -v '/com/velord/data/localization/' | grep -q .; then
echo 'Found Kotlin source in data/localization outside com.velord.data.localization.'
find data/localization/src -type f -name '*.kt' | grep -v '/com/velord/data/localization/'
exit 1
fi
if find core/core-resource/src/androidMain/res -path '*/values-*/strings.xml' | grep -q .; then
echo 'Translated Android strings.xml files are forbidden; localization.json is canonical.'
find core/core-resource/src/androidMain/res -path '*/values-*/strings.xml'
exit 1
fi

- name: Validate localization publishing script
shell: pwsh
run: ./scripts/firebase/publish-localization.ps1 -ValidateOnly

- name: Verify QA reuses Develop Firebase client
shell: bash
run: |
trap 'rm -f app/android/google-services.json' EXIT
cat > app/android/google-services.json <<'JSON'
{
"project_info": {
"project_number": "1",
"project_id": "firebase-mapping-test"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1:android:develop-test",
"android_client_info": {
"package_name": "com.velord.composescreenexample.develop"
}
},
"api_key": [
{
"current_key": "test-api-key"
}
]
}
]
}
JSON
./gradlew :app:android:processQaDebugGoogleServices --stacktrace
if [ -e app/android/src/qa/google-services.json ]; then
echo 'QA must not generate or rewrite a Firebase client configuration.'
exit 1
fi

- name: Compile and test localization
run: >-
./gradlew
:data:localization:desktopTest
:infrastructure:di:desktopTest
:app:desktop:compileKotlinDesktop
:app:android:processDevelopDebugMainManifest
:app:android:compileDevelopDebugKotlin
-x :app:android:processDevelopDebugGoogleServices
--stacktrace

- name: Compile QA
run: >-
./gradlew
:app:android:compileQaDebugKotlin
-x :app:android:processQaDebugGoogleServices
--stacktrace

- name: Compile Stage
run: >-
./gradlew
:app:android:compileStageDebugKotlin
-x :app:android:processStageDebugGoogleServices
--stacktrace

- name: Compile Production
run: >-
./gradlew
:app:android:compileProductionDebugKotlin
-x :app:android:processProductionDebugGoogleServices
--stacktrace

- name: Run project quality checks
run: >-
./gradlew
:infrastructure:konsist:test
detekt
--stacktrace
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ CLAUDE.local.md
.claude/
.claudeignore
.mcp.json

# Desktop runtime cache
app/desktop/cache/

1 change: 1 addition & 0 deletions .idea/gradle.xml

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

7 changes: 6 additions & 1 deletion app/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ android {

defaultConfig {
applicationId = "com.velord.composescreenexample"
manifestPlaceholders["appName"] = "@string/app_name"

targetSdk = libs.versions.targetApi.get().toInt()

Expand Down Expand Up @@ -62,8 +63,9 @@ android {
}
create(BuildEnvironment.Qa.value) {
dimension = "environment"
manifestPlaceholders["appName"] = "ComposeScreenExample QA"
manifestPlaceholders["enableCrashReporting"] = true
applicationIdSuffix = ".${BuildEnvironment.Qa.value}"
applicationIdSuffix = ".${BuildEnvironment.Develop.value}"
}

create(BuildEnvironment.Stage.value) {
Expand All @@ -84,6 +86,7 @@ android {
}

dependencies {
// Module Model
implementation(projects.model)
// Module Infrastructure
implementation(projects.infrastructure.util)
Expand All @@ -97,6 +100,8 @@ dependencies {
// Module Data
implementation(projects.data.os)
implementation(projects.data.appstate)
// Module Domain
implementation(projects.domain.usecaseSetting)
// Module UI
implementation(projects.ui.sharedviewmodel)
// Module UI Feature
Expand Down
2 changes: 1 addition & 1 deletion app/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<activity
android:name=".ui.main.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:label="${appName}"
android:windowSoftInputMode="adjustResize">

<intent-filter>
Expand Down
10 changes: 10 additions & 0 deletions app/android/src/main/kotlin/com/velord/composescreenexample/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ import android.os.StrictMode
import android.os.StrictMode.ThreadPolicy
import android.os.StrictMode.VmPolicy
import com.velord.data.os.memory.MemoryLeakMonitor
import com.velord.usecase.setting.InitializeLocalizationUC
import kotlinx.coroutines.runBlocking
import org.koin.android.ext.android.inject

class App : Application() {

private val memoryLeakMonitor: MemoryLeakMonitor by inject()
private val initializeLocalizationUC: InitializeLocalizationUC by inject()

override fun onCreate() {
super.onCreate()

initKoin()
initLocalization()
initStrictMode()
initMemoryLeakMonitor()
}
Expand All @@ -23,6 +27,12 @@ class App : Application() {
startKoin()
}

private fun initLocalization() {
runBlocking {
initializeLocalizationUC()
}
}

private fun initStrictMode() {
StrictMode.setThreadPolicy(
ThreadPolicy.Builder()
Expand Down
2 changes: 2 additions & 0 deletions app/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ kotlin {
implementation(projects.core.coreResource)
// Module Data
implementation(projects.data.appstate)
// Module Domain
implementation(projects.domain.usecaseSetting)
// Module UI
implementation(projects.ui.sharedviewmodel)
// Module UI Feature
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.velord.composescreenexample.desktop

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import com.velord.core.ui.compose.component.ToastHost
import com.velord.core.ui.compose.component.DesktopBackDispatcher
import com.velord.core.ui.compose.component.LocalDesktopBackDispatcher
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.KeyEventType
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.type
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import com.velord.core.ui.compose.component.DesktopBackDispatcher
import com.velord.core.ui.compose.component.LocalDesktopBackDispatcher
import com.velord.core.ui.compose.component.ToastHost
import com.velord.core.ui.theme.AppThemeHost
import com.velord.core.ui.util.ObserveSharedFlow
import com.velord.infrastructure.di.createCommonAppModuleRoster
Expand All @@ -21,17 +21,22 @@ import com.velord.model.AppEvent
import com.velord.ui.feature.splash.SplashScreen
import com.velord.ui.feature.splash.SplashVM
import com.velord.ui.sharedviewmodel.MainVM
import com.velord.usecase.setting.InitializeLocalizationUC
import kotlinx.coroutines.runBlocking
import org.koin.compose.koinInject
import org.koin.core.context.startKoin

fun main() = application {
startKoin {
val koin = startKoin {
modules(createCommonAppModuleRoster())
}.koin

runBlocking {
koin.get<InitializeLocalizationUC>()()
}

val splashVM: SplashVM = koinInject()
val mainVM: MainVM = koinInject()

val dispatcher = remember { DesktopBackDispatcher() }

Window(
Expand All @@ -43,7 +48,7 @@ fun main() = application {
} else {
false
}
}
},
) {
ObserveSharedFlow(mainVM.appEventFlow) {
when (it) {
Expand All @@ -60,7 +65,7 @@ fun main() = application {
modifier = Modifier.fillMaxSize(),
content = {
NavigationHost(navigationLib = mainVM.navigationLib)
}
},
)
}
}
Expand Down
Loading
Loading