Skip to content

Commit

Permalink
Do not build the standard .jar, only the shadow jar
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawsson committed Jul 22, 2024
1 parent 759b374 commit c1b67f5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,25 @@ tasks {
kotlinOptions.jvmTarget = "1.8"
}

build {
dependsOn(shadowJar)
}

shadowJar {
archiveFileName.set("ls-discord-bot.jar")
}

jar {
manifest {
attributes["Main-Class"] = application.mainClass
}
enabled = false // Disable the standard JAR task
}

build {
dependsOn(shadowJar)
}

withType(JavaExec::class) {
withType<JavaExec> {
doFirst {
val fileName = ".env"
if(!file(fileName).exists()) return@doFirst
if (!file(fileName).exists()) return@doFirst
file(fileName).forEachLine {
val variable = it.replace("\"", "").split("=", limit = 2)
if(variable.size > 1) {
if (variable.size > 1) {
environment(variable[0], variable[1])
}
}
Expand Down

0 comments on commit c1b67f5

Please sign in to comment.