Use build config for compiler plugin coordinates
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 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
|
||||
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
|
||||
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 {
|
||||
|
||||
@@ -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"
|
||||
|
||||
+6
-6
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user