aboutsummaryrefslogtreecommitdiff
path: root/kvision-tools/kvision-gradle-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-tools/kvision-gradle-plugin')
-rw-r--r--kvision-tools/kvision-gradle-plugin/build.gradle20
-rw-r--r--kvision-tools/kvision-gradle-plugin/build.gradle.kts44
-rw-r--r--kvision-tools/kvision-gradle-plugin/src/main/kotlin/pl/treksoft/kvision/gradle/KVisionGradleSubplugin.kt2
-rw-r--r--kvision-tools/kvision-gradle-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin1
4 files changed, 45 insertions, 22 deletions
diff --git a/kvision-tools/kvision-gradle-plugin/build.gradle b/kvision-tools/kvision-gradle-plugin/build.gradle
deleted file mode 100644
index 7b2d0f33..00000000
--- a/kvision-tools/kvision-gradle-plugin/build.gradle
+++ /dev/null
@@ -1,20 +0,0 @@
-apply plugin: 'kotlin-platform-jvm'
-apply plugin: "java-gradle-plugin"
-apply plugin: "kotlin-kapt"
-apply plugin: "maven"
-
-gradlePlugin {
- plugins {
- simplePlugin {
- id = "pl.treksoft.kvision"
- implementationClass = "pl.treksoft.kvision.gradle.KVisionGradlePlugin"
- }
- }
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
- compile "org.jetbrains.kotlin:kotlin-gradle-plugin-api:$kotlinVersion"
- compileOnly "com.google.auto.service:auto-service:$autoServiceVersion"
- kapt "com.google.auto.service:auto-service:$autoServiceVersion"
-}
diff --git a/kvision-tools/kvision-gradle-plugin/build.gradle.kts b/kvision-tools/kvision-gradle-plugin/build.gradle.kts
new file mode 100644
index 00000000..a4cc5abb
--- /dev/null
+++ b/kvision-tools/kvision-gradle-plugin/build.gradle.kts
@@ -0,0 +1,44 @@
+plugins {
+ kotlin("jvm")
+ id("java-gradle-plugin")
+ id("maven-publish")
+}
+
+val kotlinVersion: String by System.getProperties()
+val autoServiceVersion: String by project
+
+repositories()
+
+gradlePlugin {
+ plugins {
+ isAutomatedPublishing = false
+ create("simplePlugin") {
+ id = "pl.treksoft.kvision"
+ implementationClass = "pl.treksoft.kvision.gradle.KVisionGradlePlugin"
+ }
+ }
+}
+
+dependencies {
+ implementation(kotlin("stdlib-jdk8"))
+ implementation("org.jetbrains.kotlin:kotlin-gradle-plugin-api:$kotlinVersion")
+}
+
+val sourcesJar by tasks.registering(Jar::class) {
+ archiveClassifier.set("sources")
+ from(kotlin.sourceSets.main.get().kotlin)
+}
+
+publishing {
+ publications {
+ create<MavenPublication>("kotlin") {
+ from(components["kotlin"])
+ artifact(tasks["sourcesJar"])
+ pom {
+ defaultPom()
+ }
+ }
+ }
+}
+
+setupPublication()
diff --git a/kvision-tools/kvision-gradle-plugin/src/main/kotlin/pl/treksoft/kvision/gradle/KVisionGradleSubplugin.kt b/kvision-tools/kvision-gradle-plugin/src/main/kotlin/pl/treksoft/kvision/gradle/KVisionGradleSubplugin.kt
index 76bab0c0..59e2f202 100644
--- a/kvision-tools/kvision-gradle-plugin/src/main/kotlin/pl/treksoft/kvision/gradle/KVisionGradleSubplugin.kt
+++ b/kvision-tools/kvision-gradle-plugin/src/main/kotlin/pl/treksoft/kvision/gradle/KVisionGradleSubplugin.kt
@@ -21,7 +21,6 @@
*/
package pl.treksoft.kvision.gradle
-import com.google.auto.service.AutoService
import org.gradle.api.Project
import org.gradle.api.tasks.compile.AbstractCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
@@ -30,7 +29,6 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
-@AutoService(KotlinGradleSubplugin::class)
class KVisionGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
override fun apply(
project: Project,
diff --git a/kvision-tools/kvision-gradle-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin b/kvision-tools/kvision-gradle-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin
new file mode 100644
index 00000000..82f481b9
--- /dev/null
+++ b/kvision-tools/kvision-gradle-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin
@@ -0,0 +1 @@
+pl.treksoft.kvision.gradle.KVisionGradleSubplugin