Hi! I'm trying to use commonizer for project with ...
# kotlin-native
i
Hi! I'm trying to use commonizer for project with targets configured like
kotlinx.cinterops.*
was loaded properly for
nativeMain
set, but
platform.posix.*
was not loaded in it
Why?
a
I think you have to rename “common” into something else
i
You mean
commonX
source sets?
a
Or
posix
i
What's wrong with
common
name?
My hierarchy is supposed to look like
a
Hello, @Iaroslav Postovalov! I would guess that the problem here is caused by a small intersection between MinGW’s
platform.posix
with a Linux(or Apple targets) one. Maybe you can try checking it without the MinGW just to prove the commonizer works for your project?
a
What’s wrong with 
common
 name?
I think
common
is a special name.
i
@aleksey.tomin I'm just configuring default commonMain and commonTest source sets, and they do already exist
@Artyom Degtyarev [JB] 1 - before removing windows, 2 - after removing it
l
After removing and triggering gradle import/sync again?
i
Yes
a
Oh, I got it. Your host platform is Linux, that’s why it has no other platform libs.
i
So, I have to turn off targets depending on OS?
l
@Iaroslav Postovalov I think you need to add this
kotlin.native.ignoreDisabledTargets=true
in your
gradle.properties
file.
i
It is already
true
@Artyom Degtyarev [JB] but why can I build mingw or linux 64x, but can't build them both?
a
I’m not sure you can build for a mingw target on the Linux host with a default compiler, it was an experimental feature. IIRC one had to re-build the compiler from source to use it.
a
build for a mingw target on the Linux host … it was an experimental feature.
@Artyom Degtyarev [JB] can we read about this feature?
i
@Artyom Degtyarev [JB] oh
I did not notice that Gradle skips the mingw task
So, I have to adjust list of platforms depending on the host OS?
a
@aleksey.tomin see RELEASE_NOTES.md for the details.
i
@Artyom Degtyarev [JB] I've set up target management depending on host OS, and it works, but there is problem with IDEA support.
a
I am sorry, but I’m not the main commonizer expert in the team, so cannot say anything specific at the moment. My guess would be that it cannot “commonize” a single target with itself, so now there is a simple common source set named “nativeMain” for you. If you are trying to check the commonizer, plese try adding some target available for the Linux host(see here). If you want to make the project look correctly from the IDE, I would recommend you to get rid of the
nativeMain
for now.