What do I need to do for these customizations to a...
# multiplatform
d
I have it set like this, but it is not applying:
Copy code
kotlin {
    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            binaryOption("bundleShortVersionString", VERSION)
            binaryOption("bundleVersion", BUILD_NUMBER.toString())
            baseName = "ComposeApp"
            isStatic = true
        }
    }
}
👀 1
b
Don't have an answer for you, but I am working on similar config, so I'm following the thread. This does seem to work in as far as it outputs to the Info.plist in the framework module that gets generated. However, I am not sure how that merges with the rest of the xcode project and the main info.plist
Copy code
iosTarget.binaries.framework {
            baseName = "MyAppKit"
            isStatic = true
            binaryOption("bundleId", "my.applicationId")
            binaryOption("bundleShortVersionString", "1.0.0")
            binaryOption("bundleVersion", "100")
        }
I am wondering if the values are used if the main ones are not set. The main Info.plist contains:
Copy code
<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
and the identifier seems to be used. I don't know where that magical property comes from, but it looks like maybe an environment variable. I'll be following in case anyone has better info :)
something else. if you look in the project.pbxproj you can see the properties assigned to build settings that look like the environment variables: specifically: • CURRENT_PROJECT_VERSION looks like the bundleVersion (versionCode) • MARKETING_VERSION looks like the long version (versionName) so you ight be able to refer to them in the xcode config, if they are not automatically applied.
d
I only have one Info.plist. PRODUCT_BUNDLE_IDENTIFIER is an env variable that is set to BUNDLE_ID which is then set in Build Settings -> User Defined section in XCode, so I'm 95% sure that is just how it comes from the default project. I don't have neither CURRENT_PROJECT_VERSION or MARKETING_VERSION defined.
b
the KMP gradle task generates a framework during build that Info.plist has the properties. If you do a full compile or build for iOS, it will be in composeApp/build/xcode-frameworks/* I am not all that familiar with how Info.plist works, but it appears to be a little but like how Manifests merge. Maybe if there are folks familiar with XCode int he audience, they can enlighten us. The env properties are in iosApp/iosApp.xcodeproj/project.pbxproj
👍 1
d
I just ended up doing what this guy did in the article just without the github intergration and it works how I want it to: https://akobor.me/posts/programmatic-versioning-in-a-kmp-mobile-app
b
Cool I'll read that. What I ended up with, was putting the version in the libs file and then setting it in the grade build for Android, then writing a couple of files to disk containing the versions, and using PlistBuddy to set the properties on the iosApp from the gradle script. I'll be interested in taking a look at the solution.