From 111b6217da1058f1670efbc54f1851b54fe732bf Mon Sep 17 00:00:00 2001 From: Johannes Link Date: Sat, 14 Dec 2024 15:37:53 +0100 Subject: [PATCH] Moved power assert support to buildlogic.kotlin-library-conventions.gradle.kts --- gradle/libs.versions.toml | 4 +++- gradle/plugins/build.gradle.kts | 2 +- .../buildlogic.kotlin-library-conventions.gradle.kts | 7 +++++++ kotlin-core/build.gradle.kts | 1 - 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cf3474b..118ed6d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,8 @@ kotlin = '2.0.21' apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" } assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertJ" } -kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin" } +# Used in gradle plugins build.gradle.kts: +kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-powerAssertPlugin = { module = "org.jetbrains.kotlin:kotlin-power-assert", version.ref = "kotlin" } diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts index 85c8e90..4532cdf 100644 --- a/gradle/plugins/build.gradle.kts +++ b/gradle/plugins/build.gradle.kts @@ -9,5 +9,5 @@ repositories { dependencies { implementation(libs.kotlin.gradlePlugin) - implementation(libs.kotlin.stdlib) + implementation(libs.kotlin.powerAssertPlugin) } \ No newline at end of file diff --git a/gradle/plugins/src/main/kotlin/buildlogic.kotlin-library-conventions.gradle.kts b/gradle/plugins/src/main/kotlin/buildlogic.kotlin-library-conventions.gradle.kts index 5756e53..3e63082 100644 --- a/gradle/plugins/src/main/kotlin/buildlogic.kotlin-library-conventions.gradle.kts +++ b/gradle/plugins/src/main/kotlin/buildlogic.kotlin-library-conventions.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -5,6 +6,7 @@ plugins { `java-library` id("buildlogic.publish-library") id("kotlin") + kotlin("plugin.power-assert") } repositories { @@ -14,6 +16,11 @@ repositories { } } +@OptIn(ExperimentalKotlinGradlePluginApi::class) +powerAssert { + functions = listOf("kotlin.assert", "kotlin.test.assertTrue", "kotlin.test.assertEquals", "kotlin.test.assertNull") +} + dependencies { testRuntimeOnly("org.junit.platform:junit-platform-launcher") } diff --git a/kotlin-core/build.gradle.kts b/kotlin-core/build.gradle.kts index 4a72ad4..fa6fb97 100644 --- a/kotlin-core/build.gradle.kts +++ b/kotlin-core/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("buildlogic.kotlin-library-conventions") - kotlin("plugin.power-assert") version libs.versions.kotlin } description = "Jqwik2 Kotlin core support"