Skip to content

Commit

Permalink
Check that teamID is set (#3708)
Browse files Browse the repository at this point in the history
The parameter is mandatory with notarytool
  • Loading branch information
AlexeyTsvetkov authored Sep 19, 2023
1 parent 50d45f3 commit a73909e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.jetbrains.compose.desktop.application.internal.ComposeProperties
internal data class ValidatedMacOSNotarizationSettings(
val appleID: String,
val password: String,
val teamID: String?
val teamID: String
)

internal fun MacOSNotarizationSettings?.validate(): ValidatedMacOSNotarizationSettings {
Expand All @@ -25,10 +25,13 @@ internal fun MacOSNotarizationSettings?.validate(): ValidatedMacOSNotarizationSe
check(!password.orNull.isNullOrEmpty()) {
ERR_PASSWORD_IS_EMPTY
}
check(!teamID.orNull.isNullOrEmpty()) {
TEAM_ID_IS_EMPTY
}
return ValidatedMacOSNotarizationSettings(
appleID = appleID.orNull!!,
password = password.orNull!!,
teamID = teamID.orNull
teamID = teamID.orNull!!
)
}

Expand All @@ -45,3 +48,8 @@ private val ERR_PASSWORD_IS_EMPTY =
| * Use '${ComposeProperties.MAC_NOTARIZATION_PASSWORD}' Gradle property;
| * Or use 'nativeDistributions.macOS.notarization.password' DSL property;
""".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()
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ abstract class AbstractNotarizationTask @Inject constructor(
"--wait",
"--apple-id",
notarization.appleID,
"--team-id".takeIf { notarization.teamID != null },
"--team-id",
notarization.teamID,
packageFile.absolutePath
)
Expand Down

0 comments on commit a73909e

Please sign in to comment.