build.gradle.kts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. plugins {
  2. val kotlinVersion = "1.4.10"
  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. jcenter {
  12. content {
  13. includeGroup("org.jetbrains.exposed")
  14. }
  15. }
  16. }
  17. dependencies {
  18. implementation("org.telegram:telegrambots:5.3.0")
  19. implementation("io.ktor:ktor-client-cio:1.4.0")
  20. implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.0")
  21. implementation("org.jetbrains.exposed:exposed-jdbc:0.28.1")
  22. implementation("org.jetbrains.lets-plot:lets-plot-common:2.1.0")
  23. implementation("org.jetbrains.lets-plot:lets-plot-image-export:2.1.0")
  24. implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:3.0.2")
  25. implementation("org.postgresql:postgresql:42.2.18")
  26. implementation("org.slf4j:slf4j-simple:1.7.30")
  27. testImplementation("junit:junit:4.13")
  28. }
  29. application {
  30. mainClassName = "com.sirekanyan.andersrobot.Main"
  31. if (hasProperty("debug")) {
  32. applicationDefaultJvmArgs = listOf("-Ddebug")
  33. }
  34. }
  35. tasks {
  36. compileKotlin {
  37. kotlinOptions.jvmTarget = "1.8"
  38. }
  39. jar {
  40. manifest.attributes["Main-Class"] = "com.sirekanyan.andersrobot.Main"
  41. from(configurations.runtimeClasspath.get().map(::zipTree))
  42. doLast {
  43. File("bot").also { file ->
  44. file.createNewFile()
  45. file.setExecutable(true)
  46. file.printWriter().use { writer ->
  47. writer.println("#!/usr/bin/env sh")
  48. writer.println("java -jar ${archiveFileName.get()} \"$@\"")
  49. }
  50. }
  51. }
  52. }
  53. }