Use build config for compiler plugin coordinates
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# kotlin-power-assert
|
# kotlin-power-assert
|
||||||
|
|
||||||
[](https://maven-badges.herokuapp.com/maven-central/com.bnorm.power/kotlin-power-assert)
|
[](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
|
Kotlin Compiler Plugin which high-jacks Kotlin assert function calls and
|
||||||
transforms them similar to [Groovy's Power Assert feature][groovy-power-assert].
|
transforms them similar to [Groovy's Power Assert feature][groovy-power-assert].
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ plugins {
|
|||||||
kotlin("jvm") version "1.4.0" apply false
|
kotlin("jvm") version "1.4.0" apply false
|
||||||
id("org.jetbrains.dokka") version "0.10.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.gradle.plugin-publish") version "0.11.0" apply false
|
||||||
|
id("com.github.gmazzo.buildconfig") version "2.0.2" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||||||
plugins {
|
plugins {
|
||||||
id("java-gradle-plugin")
|
id("java-gradle-plugin")
|
||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
|
|
||||||
id("com.gradle.plugin-publish")
|
id("com.gradle.plugin-publish")
|
||||||
|
id("com.github.gmazzo.buildconfig")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -12,6 +12,14 @@ dependencies {
|
|||||||
implementation(kotlin("gradle-plugin-api"))
|
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 {
|
pluginBundle {
|
||||||
website = "https://github.com/bnorm/kotlin-power-assert"
|
website = "https://github.com/bnorm/kotlin-power-assert"
|
||||||
vcsUrl = "https://github.com/bnorm/kotlin-power-assert.git"
|
vcsUrl = "https://github.com/bnorm/kotlin-power-assert.git"
|
||||||
|
|||||||
+6
-6
@@ -33,15 +33,15 @@ class PowerAssertGradlePlugin : KotlinCompilerPluginSupportPlugin {
|
|||||||
override fun getCompilerPluginId(): String = "com.bnorm.kotlin-power-assert"
|
override fun getCompilerPluginId(): String = "com.bnorm.kotlin-power-assert"
|
||||||
|
|
||||||
override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
|
override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
|
||||||
groupId = "com.bnorm.power",
|
groupId = BuildConfig.PLUGIN_GROUP_ID,
|
||||||
artifactId = "kotlin-power-assert-plugin",
|
artifactId = BuildConfig.PLUGIN_ARTIFACT_ID,
|
||||||
version = "0.6.0-SNAPSHOT"
|
version = BuildConfig.PLUGIN_VERSION
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun getPluginArtifactForNative(): SubpluginArtifact = SubpluginArtifact(
|
override fun getPluginArtifactForNative(): SubpluginArtifact = SubpluginArtifact(
|
||||||
groupId = "com.bnorm.power",
|
groupId = BuildConfig.PLUGIN_GROUP_ID,
|
||||||
artifactId = "kotlin-power-assert-plugin-native",
|
artifactId = BuildConfig.PLUGIN_ARTIFACT_ID + "-native",
|
||||||
version = "0.6.0-SNAPSHOT"
|
version = BuildConfig.PLUGIN_VERSION
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun applyToCompilation(
|
override fun applyToCompilation(
|
||||||
|
|||||||
Reference in New Issue
Block a user