In Compose Multiplatform, can I specify the order in which localized strings.xml files (e.g., values-ar, values-de, etc.) are processed, so that it can be deterministic.
Right now i have a build that is non-deterministic, leading to the generation of inconsistent resource classes, such as String0_commonMainKt and String1_commonMainKt? This unpredictability stems from the inherent filesystem or plugin processing order and not something that's easily controlled.
Compose Multiplatform expects resources organized under composeResources, with subdirectories like:
composeResources/
└── values/ — default language
└── values-fr/ — French
└── values-de/ — German
└── values-es/ — Spanish
└── ...
compose.resources {
publicResClass = true
packageOfResClass = "com.module.project.resources"
generateResClass = always
}
Qualifiers like language, theme, and density are supported and prioritized when collecting resources JetBrains.
The documentation does not provide a mechanism to enforce a custom ordering when multiple resource variants are processed.
So is there a way to actually order this to ensure deterministic builds?
Update: graldle.properties file:
#Gradle
org.gradle.jvmargs=-Xmx4048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4048M" -XX:+UseSerialGC -Dkotlin.compiler.preciseCompilationResultsBackup=true
#Kotlin
kotlin.code.style=official
#Android
android.useAndroidX=true
android.nonTransitiveRClass=true
#MPP
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
android.ndkVersion=27.0.12077973
# 16KB Page Size Support, NDK r27: Enable flexible page size support for Android 15+ devices
android.native.buildOutput=verbose
android.native.useNativeCompilerSettingsCache=false
# FOR REPRODUCIBLE BUILDS
kotlin.native.binary.reproducible=true
kotlin.native.distribution.downloadFromMaven=true
# Compose compiler consistency
androidx.compose.compiler.reportsDestination=build/compose_reports
androidx.compose.compiler.metricsDestination=build/compose_metrics
# Source timestamp for reproducible builds
SOURCE_DATE_EPOCH=1640995200
# Force deterministic builds
kotlin.collections.hash.seed=0
kotlin.mpp.stability.nowarn=true
kotlin.compiler.execution.strategy=in-process
kotlin.daemon.useFallbackStrategy=false
kotlin.incremental=false
org.gradle.parallel=false
kotlin.incremental.multiplatform=false