override fun sign()

in gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/MacSigner.kt [62:93]


    override fun sign(
        file: File,
        entitlements: File?,
        forceEntitlements: Boolean
    ) {
        // sign key calculation is delayed to avoid
        // creating an external process during the configuration
        // phase, which became an error in Gradle 8.1
        // https://github.com/JetBrains/compose-multiplatform/issues/3060
        val signKey = signKeyValue ?: run {
            runTool(
                MacUtils.security,
                args = listOfNotNull(
                    "find-certificate",
                    "-a",
                    "-c",
                    settings.fullDeveloperID,
                    settings.keychain?.absolutePath
                ),
                processStdout = { signKeyValue = matchCertificates(it) }
            )
            signKeyValue!!
        }
        runTool.unsign(file)
        runTool.sign(
            file = file,
            signKey = signKey,
            entitlements = entitlements?.takeIf { forceEntitlements || file.isExecutable },
            prefix = settings.prefix,
            keychain = settings.keychain
        )
    }