45 lines
896 B
Kotlin
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 })
|
|
}
|
|
}
|