Browse Source

Check that teamID is set (#3708)

The parameter is mandatory with notarytool
dima.avdeev/update_FAQ
Alexey Tsvetkov 1 year ago committed by GitHub
parent
commit
a73909e7ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/validation/ValidatedMacOSNotarizationSettings.kt
  2. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractNotarizationTask.kt

12
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/validation/ValidatedMacOSNotarizationSettings.kt

@ -11,7 +11,7 @@ import org.jetbrains.compose.desktop.application.internal.ComposeProperties
internal data class ValidatedMacOSNotarizationSettings( internal data class ValidatedMacOSNotarizationSettings(
val appleID: String, val appleID: String,
val password: String, val password: String,
val teamID: String? val teamID: String
) )
internal fun MacOSNotarizationSettings?.validate(): ValidatedMacOSNotarizationSettings { internal fun MacOSNotarizationSettings?.validate(): ValidatedMacOSNotarizationSettings {
@ -25,10 +25,13 @@ internal fun MacOSNotarizationSettings?.validate(): ValidatedMacOSNotarizationSe
check(!password.orNull.isNullOrEmpty()) { check(!password.orNull.isNullOrEmpty()) {
ERR_PASSWORD_IS_EMPTY ERR_PASSWORD_IS_EMPTY
} }
check(!teamID.orNull.isNullOrEmpty()) {
TEAM_ID_IS_EMPTY
}
return ValidatedMacOSNotarizationSettings( return ValidatedMacOSNotarizationSettings(
appleID = appleID.orNull!!, appleID = appleID.orNull!!,
password = password.orNull!!, password = password.orNull!!,
teamID = teamID.orNull teamID = teamID.orNull!!
) )
} }
@ -45,3 +48,8 @@ private val ERR_PASSWORD_IS_EMPTY =
| * Use '${ComposeProperties.MAC_NOTARIZATION_PASSWORD}' Gradle property; | * Use '${ComposeProperties.MAC_NOTARIZATION_PASSWORD}' Gradle property;
| * Or use 'nativeDistributions.macOS.notarization.password' DSL property; | * Or use 'nativeDistributions.macOS.notarization.password' DSL property;
""".trimMargin() """.trimMargin()
private val TEAM_ID_IS_EMPTY =
"""|$ERR_PREFIX teamID is null or empty. To specify:
| * Use '${ComposeProperties.MAC_NOTARIZATION_TEAM_ID_PROVIDER}' Gradle property;
| * Or use 'nativeDistributions.macOS.notarization.teamID' DSL property;
""".trimMargin()

2
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractNotarizationTask.kt

@ -55,7 +55,7 @@ abstract class AbstractNotarizationTask @Inject constructor(
"--wait", "--wait",
"--apple-id", "--apple-id",
notarization.appleID, notarization.appleID,
"--team-id".takeIf { notarization.teamID != null }, "--team-id",
notarization.teamID, notarization.teamID,
packageFile.absolutePath packageFile.absolutePath
) )

Loading…
Cancel
Save