build.gradle.kts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
  2. import org.jetbrains.kotlin.gradle.dsl.JvmTarget
  3. plugins {
  4. kotlin("jvm") version "1.9.22"
  5. kotlin("kapt") version "1.9.22"
  6. application
  7. id("com.github.johnrengelman.shadow") version "7.1.2"
  8. }
  9. group = "com.example"
  10. version = "1.0.0-SNAPSHOT"
  11. repositories {
  12. mavenCentral()
  13. }
  14. java {
  15. toolchain {
  16. languageVersion.set(JavaLanguageVersion.of(21))
  17. }
  18. }
  19. kotlin {
  20. compilerOptions {
  21. jvmTarget = JvmTarget.JVM_21
  22. }
  23. jvmToolchain(21)
  24. }
  25. val mainClassName = "com.example.starter.App"
  26. val vertxVersion = "4.5.9"
  27. val nettyVersion = "4.1.112.Final"
  28. val scramVersion = "2.1"
  29. val dslJsonVersion = "2.0.2"
  30. val htmlFlowVersion = "4.6"
  31. val log4jVersion = "2.23.1"
  32. application {
  33. mainClass = mainClassName
  34. }
  35. dependencies {
  36. listOfNotNull(
  37. // Kotlin
  38. kotlin("stdlib-jdk8"),
  39. kotlin("reflect"),
  40. // Vertx
  41. platform("io.vertx:vertx-stack-depchain:$vertxVersion"),
  42. "io.vertx:vertx-core",
  43. "io.vertx:vertx-web",
  44. "io.vertx:vertx-pg-client",
  45. "io.vertx:vertx-lang-kotlin",
  46. "io.vertx:vertx-lang-kotlin-coroutines",
  47. // Netty
  48. "io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64",
  49. // Postgres
  50. "com.ongres.scram:client:$scramVersion",
  51. // dsljson
  52. "com.dslplatform:dsl-json:$dslJsonVersion",
  53. // HtmlFlow
  54. "com.github.xmlet:htmlflow:$htmlFlowVersion",
  55. // Logging
  56. "org.apache.logging.log4j:log4j-core:$log4jVersion",
  57. "org.apache.logging.log4j:log4j-api:$log4jVersion",
  58. "org.apache.logging.log4j:log4j-api-kotlin:1.4.0",
  59. "com.lmax:disruptor:4.0.0",
  60. ).map { implementation(it) }
  61. listOf(
  62. "com.dslplatform:dsl-json:$dslJsonVersion",
  63. "org.apache.logging.log4j:log4j-core:$log4jVersion",
  64. ).map { kapt(it) }
  65. }
  66. tasks.withType<ShadowJar> {
  67. archiveClassifier = "fat"
  68. mergeServiceFiles()
  69. }