diff --git a/README.md b/README.md index 0b24c620fa0..c537f27dd16 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # kotlin-power-assert -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.bnorm.power/kotlin-power-assert/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.bnorm.power/kotlin-power-assert) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.bnorm.power/kotlin-power-assert-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.bnorm.power/kotlin-power-assert-plugin) Kotlin Compiler Plugin which high-jacks Kotlin assert function calls and transforms them similar to [Groovy's Power Assert feature][groovy-power-assert]. diff --git a/build.gradle.kts b/build.gradle.kts index ec51cf1ae7b..7d45bbc7d83 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ plugins { kotlin("jvm") version "1.4.0" apply false id("org.jetbrains.dokka") version "0.10.0" apply false id("com.gradle.plugin-publish") version "0.11.0" apply false + id("com.github.gmazzo.buildconfig") version "2.0.2" apply false } allprojects { diff --git a/kotlin-power-assert-gradle/build.gradle.kts b/kotlin-power-assert-gradle/build.gradle.kts index 2e1da307745..47f5fad67e1 100644 --- a/kotlin-power-assert-gradle/build.gradle.kts +++ b/kotlin-power-assert-gradle/build.gradle.kts @@ -3,8 +3,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("java-gradle-plugin") kotlin("jvm") - id("com.gradle.plugin-publish") + id("com.github.gmazzo.buildconfig") } dependencies { @@ -12,6 +12,14 @@ dependencies { implementation(kotlin("gradle-plugin-api")) } +buildConfig { + val project = project(":kotlin-power-assert-plugin") + packageName(project.group.toString()) + buildConfigField("String", "PLUGIN_GROUP_ID", "\"${project.group}\"") + buildConfigField("String", "PLUGIN_ARTIFACT_ID", "\"${project.name}\"") + buildConfigField("String", "PLUGIN_VERSION", "\"${project.version}\"") +} + pluginBundle { website = "https://github.com/bnorm/kotlin-power-assert" vcsUrl = "https://github.com/bnorm/kotlin-power-assert.git" diff --git a/kotlin-power-assert-gradle/src/main/kotlin/com/bnorm/power/PowerAssertGradlePlugin.kt b/kotlin-power-assert-gradle/src/main/kotlin/com/bnorm/power/PowerAssertGradlePlugin.kt index 53579aba7b2..2008cc6d014 100644 --- a/kotlin-power-assert-gradle/src/main/kotlin/com/bnorm/power/PowerAssertGradlePlugin.kt +++ b/kotlin-power-assert-gradle/src/main/kotlin/com/bnorm/power/PowerAssertGradlePlugin.kt @@ -33,15 +33,15 @@ class PowerAssertGradlePlugin : KotlinCompilerPluginSupportPlugin { override fun getCompilerPluginId(): String = "com.bnorm.kotlin-power-assert" override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact( - groupId = "com.bnorm.power", - artifactId = "kotlin-power-assert-plugin", - version = "0.6.0-SNAPSHOT" + groupId = BuildConfig.PLUGIN_GROUP_ID, + artifactId = BuildConfig.PLUGIN_ARTIFACT_ID, + version = BuildConfig.PLUGIN_VERSION ) override fun getPluginArtifactForNative(): SubpluginArtifact = SubpluginArtifact( - groupId = "com.bnorm.power", - artifactId = "kotlin-power-assert-plugin-native", - version = "0.6.0-SNAPSHOT" + groupId = BuildConfig.PLUGIN_GROUP_ID, + artifactId = BuildConfig.PLUGIN_ARTIFACT_ID + "-native", + version = BuildConfig.PLUGIN_VERSION ) override fun applyToCompilation(