Skip to content

Commit

Permalink
publish shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
devcrocod committed Sep 17, 2021
1 parent 18072e3 commit 5fa3b4a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.gradle.publish.PluginBundleExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -57,10 +56,7 @@ tasks {
}
}

tasks.jar {
dependsOn("shadowJar")
enabled = false
}
tasks.jar { enabled = false }

val language_version: String by project
tasks.withType(KotlinCompile::class).all {
Expand All @@ -83,13 +79,20 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}

extensions.getByType(PluginBundleExtension::class).apply {
tasks.whenTaskAdded {
if (name == "publishPluginJar" || name == "generateMetadataFileForPluginMavenPublication") {
dependsOn(tasks.named("shadowJar"))
}
}

pluginBundle {
website = "https://github.com/devcrocod/korro"
vcsUrl = website
vcsUrl = "https://github.com/devcrocod/korro"
tags = listOf("kotlin", "documentation", "markdown")
}

gradlePlugin {
isAutomatedPublishing = false
plugins {
create("korro") {
id = "io.github.devcrocod.korro"
Expand All @@ -103,10 +106,8 @@ gradlePlugin {
publishing {
publications {
create<MavenPublication>("pluginMaven") {
artifact(tasks["shadowJar"])
}
create<MavenPublication>("shadow") {
project.shadow.component(this)
shadow.component(this)
// artifact(tasks["shadowJar"])
}
}
}

0 comments on commit 5fa3b4a

Please sign in to comment.