Thread
#multiplatform
    c

    Conrad Kramer

    7 months ago
    This is super random, but it would be great to document
    assembleAppleFrameworkForXcode
    somewhere. I needed to use it to depend on a Kotlin framework from an iOS framework, because
    embedAndSignAppleFrameworkForXcode
    only works in app targets
    s

    Sam

    7 months ago
    You probably want an XCFramework in that case. The assembleAppleFrameworkForXcode task just builds a framework that targets the current compilation environment (ios, ios-sim, ios-sim-arm64, etc). Building an XCFramework will allow you to build all of the target environments that you want.
    c

    Conrad Kramer

    7 months ago
    This is not an iOS framework distributed on its own as an artifact (for all possible target environments), but rather only in the context of a single build. This is an extremely common pattern:
    iOS framework -> App, several extensions
    If i want the iOS framework to depend on the Kotlin framework in any way, it needs to be compiled before the iOS framework is, and the App won’t start compiling until after the iOS framework is done if that makes sense
    (the primary reason XCFrameworks exist is to allow multiple platforms to exist in the same file, and my iOS app is an iOS app and only supports a single platform)
    Thomas

    Thomas

    6 months ago
    @Conrad Kramer do you know of a way to get this working with kotlin 1.6.20-RC? It seems the
    assembleAppleFrameworkForXcode
    task no longer exists.
    c

    Conrad Kramer

    6 months ago
    Correct!
    I use this from my framework
    export FRAMEWORKS_FOLDER_PATH=PutAnythingHere
    export EXPANDED_CODE_SIGN_IDENTITY="-"
    ./gradlew :shared:embedAndSignAppleFrameworkForXcode
    Thomas

    Thomas

    6 months ago
    Nice workaround, thanks for sharing!