swap jte for htmlflow dependencies
This commit is contained in:
parent
a80473fb35
commit
2b2e610851
21 changed files with 6 additions and 659 deletions
|
|
@ -1,10 +1,8 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import io.github.klahap.dotenv.DotEnv
|
||||
import io.github.klahap.dotenv.DotEnvBuilder
|
||||
import org. gradle.api.JavaVersion.VERSION_21
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||
import kotlin.io.path.Path
|
||||
|
||||
// ====================================================================================================
|
||||
// ENVIRONMENT CONFIGURATION
|
||||
|
|
@ -33,7 +31,6 @@ plugins {
|
|||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.shadow)
|
||||
alias(libs.plugins.dotenv.plugin)
|
||||
alias(libs.plugins.jte)
|
||||
alias(libs.plugins.tasktree)
|
||||
alias(libs.plugins.jooq.codegen.gradle)
|
||||
alias(libs.plugins.flyway)
|
||||
|
|
@ -62,16 +59,12 @@ repositories {
|
|||
// GENERATED CODE DIRECTORIES
|
||||
// ====================================================================================================
|
||||
|
||||
val generatedResourcesDir = layout.buildDirectory.dir("generated-resources")
|
||||
val generatedSourcesDir = layout.buildDirectory.dir("generated-src")
|
||||
val migrationSourceDir = layout.projectDirectory.dir("src/main/resources/db/migration")
|
||||
val jtwSourceDir = layout.projectDirectory.dir("src/main/kte")
|
||||
val jteOutputDir = generatedResourcesDir.get().dir("jte")
|
||||
val jooqOutputDir = generatedSourcesDir.get().dir("jooq")
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources.srcDir(jteOutputDir)
|
||||
kotlin.srcDir(jooqOutputDir)
|
||||
}
|
||||
}
|
||||
|
|
@ -89,7 +82,7 @@ dependencies {
|
|||
implementation(libs.dotenv)
|
||||
|
||||
// Templating
|
||||
implementation(libs.jte.kotlin)
|
||||
implementation(libs.htmlflow.kotlin)
|
||||
|
||||
// Database
|
||||
implementation(libs.bundles.database)
|
||||
|
|
@ -117,27 +110,6 @@ buildscript {
|
|||
}
|
||||
}
|
||||
|
||||
// ====================================================================================================
|
||||
// JTE TEMPLATE GENERATION
|
||||
// ====================================================================================================
|
||||
|
||||
jte {
|
||||
sourceDirectory.set(Path(jtwSourceDir.asFile.absolutePath))
|
||||
targetDirectory.set(Path(jteOutputDir.asFile.absolutePath))
|
||||
precompile()
|
||||
}
|
||||
|
||||
tasks.named("precompileJte") {
|
||||
dependsOn("compileKotlin")
|
||||
}
|
||||
|
||||
tasks.register("genJte") {
|
||||
group = "codegen"
|
||||
description = "Precompile jte template into classes"
|
||||
|
||||
dependsOn("precompileJte")
|
||||
}
|
||||
|
||||
// ====================================================================================================
|
||||
// JOOQ CODE GENERATION FROM SQL FILES
|
||||
// ====================================================================================================
|
||||
|
|
@ -263,9 +235,7 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||
attributes("Main-Class" to "at.dokkae.homepage.HomepageKt")
|
||||
}
|
||||
|
||||
dependsOn("genJte", "genJooq")
|
||||
|
||||
from(jteOutputDir)
|
||||
dependsOn("genJooq")
|
||||
|
||||
archiveFileName.set("app.jar")
|
||||
|
||||
|
|
@ -296,7 +266,6 @@ tasks.register("cleanGenerated") {
|
|||
description = "Clean all generated code"
|
||||
|
||||
doLast {
|
||||
delete(generatedResourcesDir)
|
||||
delete(generatedSourcesDir)
|
||||
logger.lifecycle("✓ Cleaned generated code directories")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue