Bradleycorn
11/10/2023, 6:03 PMxcodeConfigurationToNativeBuildType
to map configurations that might be in an XCode project to a native build type (debug or release), like this:
xcodeConfigurationToNativeBuildType["CUSTOM_BUILD_TYPE"] = NativeBuildType.DEBUG
But that requires that in my Kotlin project, I know all of the different configurations that any consuming xcode project might use when using my library. That’s impossible to know ahead of time. Is there some way that I can “calculate” the Native Build Type based on the configuration that is passed in? I thought of using mutable map’s compute
or computeIfAbsent
methods, but they still require a parameter with a “pre-known” configuration value. What I’m really looking for is something that would work kind of like this:
xcodeConfigurationToNativeBuildType.compute { inputConfig ->
return if (inputConfig.contains("CUSTOM")) {
NativeBuildType.DEBUG
} else {
NativeBuildType.RELEASE
}
}
Is there a way to achieve something like this?Bradleycorn
11/10/2023, 6:50 PM