I run `./gradlew assemble` as part of my PR check,...
# multiplatform
e
I run
./gradlew assemble
as part of my PR check, and I'm noticing that the
link*FrameworkIos*
tasks are taking a very long time. I'd like to exclude them from running so the checks finish faster, but would I be missing any potential issues by doing that, or would any Kotlin related issues get caught by other tasks?
1
j
You might want to only build a single task for iOS as assemble will build all outputs for every architecture. Maybe try to run the gradle task just for x64 simulator on the shared project
e
The problem with that is that it isn't scalable, considering I want to run
assemble
for all targets that I support (android, ios, jvm, js, and wasmJs) and keeping track of all those tasks can get painful if I start specifying each one.
j
True, but considering its a CI build you really only need to specify it one time and that way your explicitly building only what you need to get fullfilled CI build and still be fast as possible. Another thing is maybe you don't have build cache enabled? Should be faster after first build
e
*I only need to specify it one time until KGP changes the name of the task but doesn't document it 🙂 Also if I add a new target I have to remember to update CI to run its tasks. I do have cache enabled, and I could probably optimize how it works, but I'm not sure the performance boost would make this problem go away.
j
I'll let ya know what I end up doing, I have to get my CI build working soon anyways. Keep me posted
how long is it taking you btw?
e
I think the longest one (maybe
linkReleaseFrameworkIosX64
) was ~13 minutes.
j
Ya that is pretty long but also depends on how much your exposing to the native side. Make sure your KotlinNativeTarget's are all necessary and they aren't over producing duplicated dependencies. same dependency might end up multiple times in the target if referenced from multiple modules, but then you'd have naming collisions I'd believe, so sounds like that might not be an issue.
j
I disable one of the variants, same as I do with Android
j
@jw do you mean disable release vs debug? I would think
assembleDebug
or
assembleRelease
would be much faster than .
/gradlew assemble
right? Is that what your talking about?
j
Im saying that I disable the release variant of our native test suites and frameworks going to the iOS sample apps
There are no such tasks as assembleRelease and assemnleDebug outside of AGP
e
Disabling release would help (and maybe file an issue for KGP to do something similar to AGP), although
linkDebugFrameworkIosX64
takes ~10 minutes so it's still pretty long.
j
@eygraber do you happen to have
transitiveExport = true
?
You might want to try changing that to false and only export the API's you actually use in the Native iOS side. That should make the build faster as it will cut down the size of the generated framework.