Skip to content

Commit

Permalink
build: Remove shadow plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebz committed Jan 12, 2023
1 parent eabc65d commit 209ed3e
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

group = "com.felipebz.zpa"
Expand All @@ -8,7 +7,6 @@ plugins {
`maven-publish`
kotlin("jvm") version "1.8.0"
application
id("com.github.johnrengelman.shadow") version "7.1.0"
id("org.jreleaser") version "1.4.0"
id("org.jreleaser.jdks") version "1.4.0"
}
Expand All @@ -25,21 +23,6 @@ tasks.withType<KotlinJvmCompile> {
}
}

tasks.named<ShadowJar>("shadowJar") {
archiveBaseName.set("zpa-cli")
mergeServiceFiles()
minimize()
manifest {
attributes(mapOf("Main-Class" to "br.com.felipezorzo.zpa.cli.MainKt"))
}
}

tasks {
build {
dependsOn(shadowJar)
}
}

repositories {
mavenLocal()
mavenCentral()
Expand All @@ -65,6 +48,12 @@ application {
mainClass.set("br.com.felipezorzo.zpa.cli.MainKt")
}

val copyDependencies = tasks.create<Sync>("copyDependencies") {
from(configurations.runtimeClasspath)
into("${buildDir}/dependencies/flat")
}
tasks["assemble"].dependsOn(copyDependencies)

publishing {
repositories {
maven {
Expand Down Expand Up @@ -161,7 +150,10 @@ jreleaser {
path.set(file(jdkPath))
}
mainJar {
path.set(file("build/libs/zpa-cli-{{projectVersion}}-all.jar"))
path.set(file("build/libs/zpa-cli-{{projectVersion}}.jar"))
}
jars {
pattern.set("build/dependencies/flat/*.jar")
}
}
}
Expand Down

0 comments on commit 209ed3e

Please sign in to comment.