-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
64 lines (57 loc) · 2.21 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
64 lines (57 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.ksp) apply false
}
buildscript {
dependencies {
classpath(libs.oss.licenses.plugin)
}
}
tasks.register("generateLocalizedStrings") {
group = "localization"
description =
"app/language.csv 파일을 통해 지정된 모듈들의 res/values-* 위치에 strings.xml 파일을 생성합니다."
doLast {
val targets = listOf(
Triple(
project.file("app/src/main/res/values/strings.xml").absolutePath,
project.file("app/src/main/res").absolutePath,
project.file("language.csv").absolutePath
)
/* Core/Common localization is disabled for now until etc.csv is ready.
Triple(
project.file("core/common/src/main/res/values/strings.xml").absolutePath,
project.file("core/common/src/main/res").absolutePath,
project.file("etc.csv").absolutePath
)
*/
)
targets.forEach { (source, resDir, csvPath) ->
val csvFile = project.file(csvPath)
if (!csvFile.exists()) {
println("Warning: CSV file not found at ${csvFile.absolutePath}. Skipping localization for $source.")
return@forEach
}
println("Generating localized strings for: $source -> $resDir using CSV: $csvPath")
exec {
commandLine(
"python3",
"scripts/generate_android_strings.py",
csvPath,
"--source",
source,
"--res-dir",
resDir
)
}
}
}
}