Is it possible to define custom build types for pl...
# multiplatform
m
Is it possible to define custom build types for platforms other than Android? I want to add 3rd build type to my Android/iOS lib but it seems to be possible only on Android 🤔
d
Idk if I understand u correctly, but I think on iOS you can do it using Configurations. It is in XCode under project settings -> Info tab. You can then map your new configurations to android build types in
build.gradle.kts
like so:
Copy code
kotlin.cocoapods {
    xcodeConfigurationToNativeBuildType["NewConfiguration"] = NativeBuildType.DEBUG
}
m
Thanks! I will take a look at that
From what i learned currently there are only 2 build types supported for kotlin native so even if I add my own it still has to be derived from one of DEBUG or RELEASE, right?
Bc I want something like this (on Android)
Copy code
buildTypes {
        release {
            // ...
        }

        debug {
            // ...
        }
        
        create("MyCustomBuildType") {
            // ...
        }
    }
but for iOS
d
Hmm, yeah I think the multiplatform part can have only DEBUG or RELEASE. So even your android "MyCustomBuildType" is gonna have to build the multiplatform part with either of those
m
Yeah, that's what I've thought.. I've started parametrizing my project with gradle flags so I think I'll stick to it and see where it takes me
d
I mean, I am doing something little bit similar in my project. But I am using flavors for that
💡 1
m
Can You please send some snippet with flavor configuration for native targets?
d
Hm, I am using BuildKonfig library to have flavors in multiplatform. And then the native flavors are just used to set this multiplatform flavor on the whole project
m
Thank you very much I will try this library 🙌
d
Well, I dont know what exactly are you trying to achieve, but if you want to just change some resources (like a path to backend API or your remote database) and not change the actual way the project is build, this will be exactly what you need
No problem, hope it helps
🎉 1