123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
- import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
- plugins {
- kotlin("jvm") version "1.6.10"
- application
- id("nu.studer.rocker") version "3.0.4"
- id("com.github.johnrengelman.shadow") version "7.1.2"
- }
- group = "io.vertx"
- version = "4.1.5"
- repositories {
- mavenCentral()
- }
- dependencies {
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
- implementation(platform("io.vertx:vertx-stack-depchain:$version"))
- implementation("io.vertx:vertx-core")
- implementation("com.fasterxml.jackson.module:jackson-module-blackbird:2.12.4")
- implementation("io.vertx:vertx-web")
- implementation("io.vertx:vertx-pg-client")
- implementation("io.vertx:vertx-web-templ-rocker")
- implementation("io.netty", "netty-transport-native-epoll", classifier = "linux-x86_64")
- implementation("io.vertx:vertx-lang-kotlin")
- implementation("io.vertx:vertx-lang-kotlin-coroutines")
- }
- rocker {
- configurations {
- create("main") {
- templateDir.set(file("src/main/resources"))
- optimize.set(true)
- javaVersion.set("1.8")
- }
- }
- }
- tasks.withType<KotlinCompile> {
- kotlinOptions.jvmTarget = "11"
- }
- // content below copied from the project generated by the app generator
- val mainVerticleName = "io.vertx.benchmark.App"
- val launcherClassName = "io.vertx.core.Launcher"
- application {
- mainClass.set(launcherClassName)
- }
- tasks.withType<ShadowJar> {
- archiveClassifier.set("fat")
- manifest {
- attributes(mapOf("Main-Verticle" to mainVerticleName))
- }
- mergeServiceFiles()
- }
- val watchForChange = "src/**/*"
- val doOnChange = "${projectDir}/gradlew classes"
- tasks.withType<JavaExec> {
- args = listOf(
- "run",
- mainVerticleName,
- "--redeploy=$watchForChange",
- "--launcher-class=$launcherClassName",
- "--on-redeploy=$doOnChange"
- )
- }
|