add fatJar

This commit is contained in:
Aria Moradi
2021-01-20 03:05:40 +03:30
parent a7e63565ef
commit ace471abdb
6 changed files with 78 additions and 3 deletions
+42 -1
View File
@@ -1,6 +1,9 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
// id("org.jetbrains.kotlin.jvm") version "1.4.21"
application
id("com.github.johnrengelman.shadow") version "6.1.0"
}
@@ -84,5 +87,43 @@ dependencies {
}
application {
mainClass.set("ir.armor.tachidesk.Main")
val name = "ir.armor.tachidesk.Main"
mainClass.set(name)
// Required by ShadowJar.
mainClassName = name
}
sourceSets {
main {
resources {
srcDir("src/main/resources")
}
}
}
tasks {
jar {
manifest {
attributes(
mapOf(
"Main-Class" to "com.example.MainKt", //will make your jar (produced by jar task) runnable
"ImplementationTitle" to project.name,
"Implementation-Version" to project.version)
)
}
}
shadowJar {
manifest.inheritFrom(jar.get().manifest) //will make your shadowJar (produced by jar task) runnable
}
}
tasks.withType<ShadowJar> {
destinationDir = File("$rootDir/server/build")
//dependsOn(":webUI:copyBuild")
}
tasks.named("processResources") {
dependsOn(":webUI:copyBuild")
}
@@ -37,7 +37,12 @@ class Main {
val app = Javalin.create().start(4567)
val app = Javalin.create { config ->
// config.addSinglePageRoot("/", "")
config.addStaticFiles("/react")
}.start(4567)
app.before() { ctx ->
// allow the client which is running on another port