Skip to content

Commit 5c0701e

Browse files
committed
use shadowjar distribution
1 parent 5f9f7cd commit 5c0701e

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

build.gradle.kts

+34-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
12
import org.jreleaser.model.Active
23
import org.jreleaser.model.Distribution
34
import org.jreleaser.model.Stereotype
@@ -13,9 +14,9 @@ import java.util.*
1314
*/
1415

1516
plugins {
16-
id("com.github.johnrengelman.shadow") version "8.1.1"
17+
id("com.gradleup.shadow") version "8.3.5"
1718
id("io.micronaut.application") version "4.4.3"
18-
id("org.jreleaser") version "1.14.0"
19+
id("org.jreleaser") version "1.15.0"
1920
}
2021

2122
val versionProperties = Properties().apply {
@@ -65,6 +66,11 @@ dependencies {
6566
implementation("ch.qos.logback:logback-classic:1.5.11")
6667
}
6768

69+
java {
70+
sourceCompatibility = JavaVersion.VERSION_21
71+
targetCompatibility = JavaVersion.VERSION_21
72+
}
73+
6874
application {
6975
applicationName = "subpop"
7076
mainClass = "io.clusterless.subpop.Main"
@@ -76,11 +82,20 @@ distributions {
7682
}
7783
}
7884

79-
java {
80-
sourceCompatibility = JavaVersion.VERSION_21
81-
targetCompatibility = JavaVersion.VERSION_21
85+
tasks.withType<ShadowJar>{
86+
archiveBaseName.set("subpop")
87+
}
88+
89+
tasks.named<Zip>("shadowDistZip") {
90+
archiveBaseName.set("subpop")
8291
}
8392

93+
tasks.named<Tar>("shadowDistTar") {
94+
archiveBaseName.set("subpop")
95+
}
96+
97+
98+
8499
tasks.withType<Test> {
85100
useJUnitPlatform()
86101
maxHeapSize = "5g" // Set the desired maximum heap size
@@ -193,8 +208,21 @@ jreleaser {
193208
}
194209
}
195210

211+
tasks.named("distZip"){
212+
enabled = false
213+
}
214+
215+
tasks.named("distTar"){
216+
enabled = false
217+
}
218+
219+
tasks.named("jreleaserRelease") {
220+
dependsOn("shadowDistZip")
221+
dependsOn("shadowDistTar")
222+
}
223+
196224
tasks.register("release") {
197-
dependsOn("distZip")
225+
dependsOn("shadowDistZip")
198226
dependsOn("jreleaserRelease")
199227
dependsOn("jreleaserPackage")
200228
dependsOn("jreleaserPublish")

0 commit comments

Comments
 (0)