gbaldeck
08/27/2026, 12:03 PMmodule.yaml files, is there a way to access versions from our libs.versions.toml file similar to how we use $libs?Tanish Azad
08/27/2026, 12:46 PMgradle/libs.versions.toml and libs.versions.toml simultaneously?
kotlin-toolchain.org/latest/user-guide/dependencies#…joffrey
08/27/2026, 1:01 PMsettings:, right?
Could you please share for which setting you wanted to have that? (just so I get a better idea of the case at hand, even though we know it's a general problem)joffrey
08/27/2026, 1:03 PM$kotlin.* with a bunch of libs that you would use the Kotlin version for. We provide $compose.* for things that require the Compose version. So in theory you should still be able to configure each particular version in a single place (e.g. in a template that applies settings.kotlin.version or settings.compose.version ).
Now indeed, it would be best if all versions could be in the same place (e.g. the library catalog).gbaldeck
08/27/2026, 1:15 PMlibs.versions.toml.
I am using templates to minimize the amount of times I need to set versions, but it would still be nice to have the versions in 1 file so that we don't need to jump around.
For example, the kotlin and serialization version in my base template below.
settings:
kotlin:
version: 2.4.10
freeCompilerArgs:
- "-Xannotation-default-target=param-property"
serialization:
enabled: true
version: 1.11.0
compilerPlugins:
- id: dev.mokkery
dependency: $libs.mokkery.plugin
# options:
# defaultMockMode: autoUnit # Optional: strict, autoUnit, etc.
# defaultVerifyMode: soft # Optional: soft, exhaustive, etc.
dependencies:
- $libs.kotlinx.coroutines.core
- $libs.mokkery.runtime: compile-only
test-dependencies:
- $libs.kotlinx.coroutines.test
- $libs.mokkery.runtime
- $libs.turbinejoffrey
08/27/2026, 1:26 PMproject.yaml, and when that happens we'll think about version references)gbaldeck
08/27/2026, 1:32 PMjoffrey
08/27/2026, 1:33 PMtest-settings section instead of settings, just like you do test-dependencies instead of dependencies for the runtime:
settings:
kotlin:
version: 2.4.10
freeCompilerArgs:
- "-Xannotation-default-target=param-property"
serialization:
enabled: true
version: 1.11.0
test-settings:
kotlin:
compilerPlugins:
- id: dev.mokkery
dependency: $libs.mokkery.plugin
# options:
# defaultMockMode: autoUnit # Optional: strict, autoUnit, etc.
# defaultVerifyMode: soft # Optional: soft, exhaustive, etc.
dependencies:
- $libs.kotlinx.coroutines.core
test-dependencies:
- $libs.kotlinx.coroutines.test
- $libs.mokkery.runtime
- $libs.turbinesuresh
08/31/2026, 4:24 AMfreeCompilerArgs:
- -Xexplicit-api=strict
But I don’t want strict explicit APIs for my test classes and functions. Right now, I am doing
test-settings:
kotlin:
freeCompilerArgs:
- -Xexplicit-api=disable
which produces the following warning
ERROR warning: argument '-Xexplicit-api' is passed multiple times: 'strict', 'disable'. The last value will be used.joffrey
08/31/2026, 10:28 AM-Xexplicit-api. So I believe that we don't need to implement the full complex feature to solve the vast majority of the problems, we can just define a custom field explcitApi, and decide that this one doesn't apply to tests:
KTC-5787 Support settings.kotlin.explicitApi property and ignore it for test sources