update gradle configuration and wrapper

This commit is contained in:
UrAvgCode 2025-11-05 23:44:31 +01:00
parent 9828227f41
commit 84ee6ac378
No known key found for this signature in database
GPG key ID: 8A76A22B2CDDD634
8 changed files with 77 additions and 56 deletions

45
build.gradle.kts Normal file
View file

@ -0,0 +1,45 @@
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 })
}
}