Skip to content

Commit

Permalink
build: enable power-assert
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK committed Feb 22, 2025
1 parent 48bbb51 commit 731b9ba
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
38 changes: 34 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@file:OptIn(ExperimentalKotlinGradlePluginApi::class)

import de.aaschmid.gradle.plugins.cpd.Cpd
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jlleitschuh.gradle.ktlint.tasks.GenerateReportsTask

plugins {
Expand All @@ -11,6 +14,7 @@ plugins {
alias(libs.plugins.kotest)
alias(libs.plugins.kotlin.qa)
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.power.assert)
alias(libs.plugins.publishOnCentral)
alias(libs.plugins.taskTree)
id("it.unibo.collektive.collektive-plugin")
Expand All @@ -28,16 +32,42 @@ allprojects {

with(rootProject.libs.plugins) {
apply(plugin = dokka.id)
apply(plugin = publishOnCentral.id)
apply(plugin = gitSemVer.id)
apply(plugin = kotest.id)
apply(plugin = kotlin.qa.id)
apply(plugin = kotlinx.serialization.id)
apply(plugin = gitSemVer.id)
apply(plugin = taskTree.id)
apply(plugin = kover.id)
apply(plugin = kotest.id)
apply(plugin = power.assert.id)
apply(plugin = publishOnCentral.id)
apply(plugin = taskTree.id)
}
apply(plugin = "it.unibo.collektive.collektive-plugin")

powerAssert {
val kotlinAssertions = listOf(
"assert",
"check",
"checkNotNull",
"require",
"requireNotNull",
)
val testAssertions = listOf(
"Contains",
"ContentEquals",
"Equals",
"False",
"Is",
"IsNot",
"NotEquals",
"NotNull",
"NotSame",
"Null",
"Same",
"True",
).map { "test.assert$it" }
functions = (kotlinAssertions + testAssertions).map { "kotlin.$it" }
}

signing {
if (System.getenv("CI") == "true") {
val signingKey: String? by project
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ kotlin-qa = "org.danilopianini.gradle-kotlin-qa:0.78.0"
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kover = "org.jetbrains.kotlinx.kover:0.9.1"
multiJvmTesting = "org.danilopianini.multi-jvm-test-plugin:3.2.2"
power-assert = { id = "org.jetbrains.kotlin.plugin.power-assert", version.ref = "kotlin" }
publishOnCentral = "org.danilopianini.publish-on-central:8.0.3"
taskTree = "com.dorongold.task-tree:4.0.0"

0 comments on commit 731b9ba

Please sign in to comment.