global-whitelist/build.gradle.kts
2025-11-05 23:53:17 +01:00

45 lines
896 B
Kotlin

plugins {
java
alias(libs.plugins.run.velocity)
}
group = "com.uravgcode"
version = "1.0"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
dependencies {
compileOnly(libs.velocity.api)
annotationProcessor(libs.velocity.api)
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
runVelocity {
velocityVersion("3.4.0-SNAPSHOT")
}
}
val templateSource = file("src/main/templates")
val templateDest = layout.buildDirectory.dir("generated/sources/templates")
val generateTemplates by tasks.registering(Copy::class) {
val props = mapOf("version" to project.version)
inputs.properties(props)
from(templateSource)
into(templateDest)
expand(props)
}
sourceSets {
named("main") {
java.srcDir(generateTemplates.map { it.outputs })
}
}