build.gradle.kts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
  2. tasks.wrapper {
  3. distributionType = Wrapper.DistributionType.ALL
  4. }
  5. plugins {
  6. kotlin("jvm") version "2.0.21"
  7. application
  8. id("nu.studer.rocker") version "3.0.4"
  9. id("com.gradleup.shadow") version "8.3.4"
  10. }
  11. group = "io.vertx"
  12. version = "4.3.8" // 4.5.10 is available, but this is not updated to be kept consistent with the "vert-web" portion
  13. repositories {
  14. mavenCentral()
  15. }
  16. dependencies {
  17. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
  18. implementation(platform("io.vertx:vertx-stack-depchain:$version"))
  19. implementation("io.vertx:vertx-core")
  20. implementation("com.fasterxml.jackson.module:jackson-module-blackbird:2.14.2") // 2.18.1 is available, but this is not updated to be kept consistent with the "vert-web" portion
  21. implementation("io.vertx:vertx-web")
  22. implementation("io.vertx:vertx-pg-client")
  23. implementation("io.vertx:vertx-web-templ-rocker")
  24. runtimeOnly("io.netty", "netty-transport-native-epoll", classifier = "linux-x86_64")
  25. // not used to make the project consistent with the "vert-web" portion
  26. /*
  27. runtimeOnly("io.vertx:vertx-io_uring-incubator")
  28. runtimeOnly("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.25.Final:linux-x86_64")
  29. */
  30. implementation("io.vertx:vertx-lang-kotlin")
  31. implementation("io.vertx:vertx-lang-kotlin-coroutines")
  32. }
  33. rocker {
  34. configurations {
  35. create("main") {
  36. templateDir.set(file("src/main/resources"))
  37. optimize.set(true)
  38. javaVersion.set("17") // kept consistent with the "vert-web" portion
  39. }
  40. }
  41. }
  42. kotlin.jvmToolchain(17) // kept consistent with the "vert-web" portion
  43. // content below copied from the project generated by the app generator
  44. val mainVerticleName = "io.vertx.benchmark.App"
  45. val launcherClassName = "io.vertx.core.Launcher"
  46. application {
  47. mainClass.set(launcherClassName)
  48. }
  49. tasks.withType<ShadowJar> {
  50. archiveClassifier.set("fat")
  51. manifest {
  52. attributes(mapOf("Main-Verticle" to mainVerticleName))
  53. }
  54. mergeServiceFiles()
  55. }
  56. val watchForChange = "src/**/*"
  57. val doOnChange = "${projectDir}/gradlew classes"
  58. tasks.withType<JavaExec> {
  59. args = listOf(
  60. "run",
  61. mainVerticleName,
  62. "--redeploy=$watchForChange",
  63. "--launcher-class=$launcherClassName",
  64. "--on-redeploy=$doOnChange"
  65. )
  66. }