58 lines
1.7 KiB
Text
58 lines
1.7 KiB
Text
|
plugins {
|
||
|
// Apply the shared build logic from a convention plugin.
|
||
|
// The shared code is located in `buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts`.
|
||
|
id("buildsrc.convention.kotlin-jvm")
|
||
|
alias(libs.plugins.tempolin)
|
||
|
|
||
|
// Apply the Application plugin to add support for building an executable JVM application.
|
||
|
application
|
||
|
}
|
||
|
|
||
|
dependencies {
|
||
|
implementation(libs.slf4jsimple)
|
||
|
implementation(libs.javalin)
|
||
|
implementation(libs.commonsText)
|
||
|
implementation(project(":core"))
|
||
|
}
|
||
|
|
||
|
application {
|
||
|
// Define the Fully Qualified Name for the application main class
|
||
|
// (Note that Kotlin compiles `App.kt` to a class with FQN `com.example.app.AppKt`.)
|
||
|
mainClass = "net.h34t.app.AppKt"
|
||
|
}
|
||
|
|
||
|
sourceSets {
|
||
|
main {
|
||
|
kotlin {
|
||
|
// include the generated source files
|
||
|
srcDir("${layout.buildDirectory.get()}/generated-sources/tempolin")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
tasks.getByName("compileKotlin") {
|
||
|
dependsOn("tempolin")
|
||
|
}
|
||
|
|
||
|
tempolin {
|
||
|
add {
|
||
|
// place all templates in this directory
|
||
|
// subdirectories become packages
|
||
|
templateDirectory = "$projectDir/src/main/tpl"
|
||
|
|
||
|
// output directory for the generated templates
|
||
|
outputDirectory = "${layout.buildDirectory.get()}/generated-sources/tempolin"
|
||
|
|
||
|
// currently, there's only the "kotlin" generator
|
||
|
// optional, default is "kotlin"
|
||
|
compilationTarget = "kotlin"
|
||
|
|
||
|
// an optional input file filter
|
||
|
fileFilter = { file -> file.extension == "html" }
|
||
|
|
||
|
// set the name and package of the template interface
|
||
|
// defaults to "net.h34t.TempolinTemplate"
|
||
|
templateInterface = "net.h34t.filemure.Template"
|
||
|
|
||
|
}
|
||
|
}
|