Hello, What is `runCommonizer` task about? I jus...
# multiplatform
r
Hello, What is
runCommonizer
task about? I just came back to my old multiplatform project (updated all deps) and this task takes forever (over 1h). Is there a way to make it run faster or disable it? Or configure the project the way that I dont need it? It takes that long on both macOS and windows11 platforms.
r
Commonizer is a tool that finds the subset of APIs on native platforms that are available to intermediate sources. For example, if you have an
iosMain
source that's included in
iosX64Main
and
iosArm64Main
, it computes what native APIs are available so that you're not limited only to the things available in
commonMain
.
You can disable it by removing
kotlin.native.enableDependencyPropagation=false
from your gradle.properties but that will impact anyone consuming the module since they won't be able to detect what APIs are available in shared sources.
l
Note that it's much faster in recent Kotlin versions. Which version of Kotlin is the project using at the time?
r
After disabling it I noticed that the project still takes long time to sync… it is kotlin: 1.6.0-M1 gradle: gradle-7.3.1-all.zip android build tools: 7.0.4 I got also this properties set:
Copy code
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.binary.memoryModel=experimental
kotlin.native.binary.freezing=disabled
l
Event after the second time?
How long, how many modules, and on which machine?
r
second time is normal but if i modify something in the build script it will go long again 13 modules, each with kotlin multiplatform plugin, MBP 15 i7 2019 takes 1h30min, ryzen5000 series does it in 1h
it is Android Studio AF 2020.3.1 Patch 3
l
Wow, that's insane numbers. I have a 40+ modules MPP, and it takes much less time
It takes like 2 minutes or less for the Gradle sync itself, though IDE indexing might bump the entire operation up to 10 minutes
r
what combination of library/plugin/kotlin version do you use?
l
1.5.31
It's named Splitties if you want to look at it, it's open source on GitHub
I personally open it in IntelliJ IDEA, but it should work in AS as well
r
nice project! thanks for sharing
where do you set versions of the dependencies? I see "_" everywhere instead of version
ok I got it!
l
Using refreshVersions for that, which I also maintain 🙃 Versions are in the
versions.properties
file