diff --git a/plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/api/LicenseExpression.kt b/plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/api/LicenseExpression.kt index c4a455b..7a20bb6 100644 --- a/plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/api/LicenseExpression.kt +++ b/plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/api/LicenseExpression.kt @@ -160,7 +160,7 @@ fun LicenseExpression.weight(): Int = is JustLicense -> 1 is OrLaterLicense -> 2 is WithException -> license.weight() + 1 - is ConjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.max() ?: 1 - is DisjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.max() ?: 1 + is ConjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.maxOrNull() ?: 1 + is DisjunctionLicenseExpression -> licenses.map { it.weight() + 1 }.maxOrNull() ?: 1 else -> TODO("Unexpected expression: ${this::class.simpleName}: $this") } diff --git a/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/Apache2LicenseInterpreter.kt b/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/Apache2LicenseInterpreter.kt index 5a5ce74..64b80f8 100644 --- a/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/Apache2LicenseInterpreter.kt +++ b/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/Apache2LicenseInterpreter.kt @@ -41,9 +41,9 @@ class Apache2LicenseInterpreter { return when (e) { is DisjunctionLicenseExpression -> // A or X => A - e.unordered.map { eval(it) }.min() + e.unordered.map { eval(it) }.minOrNull() is ConjunctionLicenseExpression -> - e.unordered.map { eval(it) }.max() + e.unordered.map { eval(it) }.maxOrNull() else -> null } ?: AsfLicenseCategory.UNKNOWN } diff --git a/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/StageVoteReleasePlugin.kt b/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/StageVoteReleasePlugin.kt index 5d849a6..0b8e2bf 100644 --- a/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/StageVoteReleasePlugin.kt +++ b/plugins/stage-vote-release-plugin/src/main/kotlin/com/github/vlsi/gradle/release/StageVoteReleasePlugin.kt @@ -675,7 +675,7 @@ class StageVoteReleasePlugin @Inject constructor(private val instantiator: Insta Pair(listOf(), mapOf()) } - val svnStagingRevision = stagedFiles.map { it.commit.revision }.max() ?: 0 + val svnStagingRevision = stagedFiles.map { it.commit.revision }.maxOrNull() ?: 0 val releaseParams = ReleaseParams( tlp = releaseExt.tlp.get(),