Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 22a1e16

Browse files
committed
Use build config for compiler plugin coordinates
1 parent 0de9c80 commit 22a1e16

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# kotlin-power-assert
22

3-
[![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)
3+
[![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)
44

55
Kotlin Compiler Plugin which high-jacks Kotlin assert function calls and
66
transforms them similar to [Groovy's Power Assert feature][groovy-power-assert].

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
kotlin("jvm") version "1.4.0" apply false
33
id("org.jetbrains.dokka") version "0.10.0" apply false
44
id("com.gradle.plugin-publish") version "0.11.0" apply false
5+
id("com.github.gmazzo.buildconfig") version "2.0.2" apply false
56
}
67

78
allprojects {

kotlin-power-assert-gradle/build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
plugins {
44
id("java-gradle-plugin")
55
kotlin("jvm")
6-
76
id("com.gradle.plugin-publish")
7+
id("com.github.gmazzo.buildconfig")
88
}
99

1010
dependencies {
1111
implementation(kotlin("stdlib"))
1212
implementation(kotlin("gradle-plugin-api"))
1313
}
1414

15+
buildConfig {
16+
val project = project(":kotlin-power-assert-plugin")
17+
packageName(project.group.toString())
18+
buildConfigField("String", "PLUGIN_GROUP_ID", "\"${project.group}\"")
19+
buildConfigField("String", "PLUGIN_ARTIFACT_ID", "\"${project.name}\"")
20+
buildConfigField("String", "PLUGIN_VERSION", "\"${project.version}\"")
21+
}
22+
1523
pluginBundle {
1624
website = "https://github.com/bnorm/kotlin-power-assert"
1725
vcsUrl = "https://github.com/bnorm/kotlin-power-assert.git"

kotlin-power-assert-gradle/src/main/kotlin/com/bnorm/power/PowerAssertGradlePlugin.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class PowerAssertGradlePlugin : KotlinCompilerPluginSupportPlugin {
3333
override fun getCompilerPluginId(): String = "com.bnorm.kotlin-power-assert"
3434

3535
override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
36-
groupId = "com.bnorm.power",
37-
artifactId = "kotlin-power-assert-plugin",
38-
version = "0.6.0-SNAPSHOT"
36+
groupId = BuildConfig.PLUGIN_GROUP_ID,
37+
artifactId = BuildConfig.PLUGIN_ARTIFACT_ID,
38+
version = BuildConfig.PLUGIN_VERSION
3939
)
4040

4141
override fun getPluginArtifactForNative(): SubpluginArtifact = SubpluginArtifact(
42-
groupId = "com.bnorm.power",
43-
artifactId = "kotlin-power-assert-plugin-native",
44-
version = "0.6.0-SNAPSHOT"
42+
groupId = BuildConfig.PLUGIN_GROUP_ID,
43+
artifactId = BuildConfig.PLUGIN_ARTIFACT_ID + "-native",
44+
version = BuildConfig.PLUGIN_VERSION
4545
)
4646

4747
override fun applyToCompilation(

0 commit comments

Comments
 (0)