76 lines
1.9 KiB
Kotlin
76 lines
1.9 KiB
Kotlin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
plugins {
|
|
alias(libs.plugins.jvm)
|
|
application
|
|
alias(libs.plugins.serialization)
|
|
alias(libs.plugins.shadow)
|
|
}
|
|
|
|
group = "com.jaytux.phoebench"
|
|
version = "1.0.1"
|
|
|
|
val versionDirectory = layout.buildDirectory.dir("generated/sources/version")
|
|
val generateVersion = tasks.register<Task>("serverVersion") {
|
|
doFirst {
|
|
val outFile = versionDirectory.get().file("com/jaytux/phoebench/client/cli/Version.kt").asFile
|
|
outFile.parentFile.mkdirs()
|
|
outFile.writeText("""
|
|
package com.jaytux.phoebench.client.cli
|
|
|
|
object CliVersion {
|
|
const val VERSION="$version"
|
|
}
|
|
""".trimIndent())
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(kotlin("stdlib"))
|
|
implementation(libs.clikt)
|
|
implementation(libs.ktor.client.core)
|
|
implementation(libs.ktor.client.auth)
|
|
implementation(libs.ktor.client.content.negotiation)
|
|
implementation(libs.kotlinx.datetime)
|
|
implementation(libs.kotlinx.serialization)
|
|
implementation(project(":common"))
|
|
implementation(kotlin("reflect"))
|
|
implementation(libs.ktor.client.okhttp)
|
|
implementation(libs.slf4j.simple)
|
|
implementation(libs.java.keystore)
|
|
implementation(libs.ktor.serialization.kotlinx.json)
|
|
}
|
|
|
|
application {
|
|
mainClass = "com.jaytux.phoebench.clients.cli.MainKt"
|
|
}
|
|
|
|
tasks.withType<Jar> {
|
|
manifest {
|
|
attributes["Main-Class"] = application.mainClass
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(21)
|
|
compilerOptions {
|
|
freeCompilerArgs.add("-Xcontext-parameters")
|
|
optIn.add("kotlin.uuid.ExperimentalUuidApi")
|
|
}
|
|
|
|
sourceSets {
|
|
val main by getting {
|
|
kotlin {
|
|
srcDir(versionDirectory)
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.compileKotlin {
|
|
dependsOn(generateVersion)
|
|
}
|
|
}
|
|
|
|
tasks.withType<ShadowJar> {
|
|
archiveFileName = "phoebench-cli.jar"
|
|
} |