2024-10-27 13:03:10 +03:00
|
|
|
import mihon.buildlogic.generatedBuildDir
|
2024-07-04 14:43:31 +03:00
|
|
|
import mihon.buildlogic.tasks.getLocalesConfigTask
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
2022-09-10 16:58:45 +03:00
|
|
|
plugins {
|
2024-07-04 14:43:31 +03:00
|
|
|
id("mihon.library")
|
|
|
|
kotlin("multiplatform")
|
2024-10-30 01:07:16 +03:00
|
|
|
alias(libs.plugins.moko)
|
2023-12-02 13:31:48 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
androidTarget()
|
2024-06-02 16:45:15 +03:00
|
|
|
|
|
|
|
applyDefaultHierarchyTemplate()
|
|
|
|
|
2023-12-02 13:31:48 +03:00
|
|
|
sourceSets {
|
2024-07-12 22:07:44 +03:00
|
|
|
commonMain {
|
2023-12-02 13:31:48 +03:00
|
|
|
dependencies {
|
|
|
|
api(libs.moko.core)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-10 16:58:45 +03:00
|
|
|
}
|
|
|
|
|
2024-10-27 13:03:10 +03:00
|
|
|
val generatedAndroidResourceDir = generatedBuildDir.resolve("android/res")
|
|
|
|
|
2022-09-10 16:58:45 +03:00
|
|
|
android {
|
2023-05-23 23:37:41 +03:00
|
|
|
namespace = "tachiyomi.i18n"
|
2022-10-05 16:26:42 +03:00
|
|
|
|
2023-12-02 13:31:48 +03:00
|
|
|
sourceSets {
|
2024-10-27 13:03:10 +03:00
|
|
|
val main by getting
|
|
|
|
main.res.srcDirs(
|
|
|
|
"src/commonMain/resources",
|
|
|
|
generatedAndroidResourceDir,
|
|
|
|
)
|
2023-12-02 13:31:48 +03:00
|
|
|
}
|
|
|
|
|
2022-10-05 16:26:42 +03:00
|
|
|
lint {
|
|
|
|
disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))
|
|
|
|
}
|
2022-09-10 16:58:45 +03:00
|
|
|
}
|
|
|
|
|
2023-12-02 13:31:48 +03:00
|
|
|
multiplatformResources {
|
2024-06-30 22:29:59 +03:00
|
|
|
resourcesPackage.set("tachiyomi.i18n")
|
2023-12-02 13:31:48 +03:00
|
|
|
}
|
|
|
|
|
2022-09-10 16:58:45 +03:00
|
|
|
tasks {
|
2024-10-27 13:03:10 +03:00
|
|
|
val localesConfigTask = project.getLocalesConfigTask(generatedAndroidResourceDir)
|
2022-09-10 16:58:45 +03:00
|
|
|
preBuild {
|
2023-12-02 13:31:48 +03:00
|
|
|
dependsOn(localesConfigTask)
|
2022-09-10 16:58:45 +03:00
|
|
|
}
|
2023-12-02 13:55:50 +03:00
|
|
|
|
2024-07-04 14:43:31 +03:00
|
|
|
withType<KotlinCompile> {
|
2024-06-30 22:29:59 +03:00
|
|
|
compilerOptions.freeCompilerArgs.addAll(
|
|
|
|
listOf(
|
|
|
|
"-Xexpect-actual-classes",
|
|
|
|
),
|
2023-11-28 01:08:16 +03:00
|
|
|
)
|
|
|
|
}
|
2022-09-10 16:58:45 +03:00
|
|
|
}
|