build.gradle.kts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. plugins {
  2. val kotlinVersion = "1.7.20"
  3. kotlin("jvm") version kotlinVersion
  4. kotlin("plugin.serialization") version kotlinVersion
  5. application
  6. }
  7. group = "com.sirekanyan"
  8. version = "0.1"
  9. repositories {
  10. mavenCentral()
  11. }
  12. dependencies {
  13. implementation("org.telegram:telegrambots:6.1.0")
  14. implementation("io.ktor:ktor-client-cio:2.1.2")
  15. implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
  16. implementation("org.jetbrains.exposed:exposed-jdbc:0.40.1")
  17. implementation("org.jetbrains.lets-plot:lets-plot-common:2.5.0")
  18. implementation("org.jetbrains.lets-plot:lets-plot-image-export:2.5.0")
  19. implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.1.0")
  20. implementation("org.postgresql:postgresql:42.5.0")
  21. implementation("org.slf4j:slf4j-simple:2.0.3")
  22. testImplementation("junit:junit:4.13.2")
  23. }
  24. application {
  25. mainClass.set("com.sirekanyan.andersrobot.Main")
  26. if (hasProperty("debug")) {
  27. applicationDefaultJvmArgs = listOf("-Ddebug")
  28. }
  29. }
  30. tasks {
  31. compileKotlin {
  32. kotlinOptions {
  33. jvmTarget = "1.8"
  34. allWarningsAsErrors = true
  35. }
  36. }
  37. jar {
  38. manifest.attributes["Main-Class"] = "com.sirekanyan.andersrobot.Main"
  39. from(configurations.runtimeClasspath.get().map(::zipTree))
  40. doLast {
  41. File("bot").also { file ->
  42. file.createNewFile()
  43. file.setExecutable(true)
  44. file.printWriter().use { writer ->
  45. writer.println("#!/usr/bin/env sh")
  46. writer.println("java -jar ${archiveFileName.get()} \"$@\"")
  47. }
  48. }
  49. }
  50. }
  51. }