build.gradle 875 B

123456789101112131415161718192021222324252627282930313233
  1. plugins {
  2. id("gg.jte.gradle") version("3.1.4")
  3. }
  4. dependencies {
  5. api(project(":model"))
  6. api("com.hexagonkt:http_server:$hexagonVersion")
  7. api("com.hexagonkt:templates_jte:$hexagonVersion")
  8. api("com.hexagonkt:serialization_jackson_json:$hexagonVersion")
  9. api("org.cache2k:cache2k-core:$cache2kVersion")
  10. jteGenerate("gg.jte:jte-native-resources:3.1.4")
  11. }
  12. tasks.register("minimizeTemplate") {
  13. doLast {
  14. File template = file("$buildDir/resources/main/fortunes.jte")
  15. List<String> lines = template.readLines().collect { it.trim() }
  16. template.write(lines.join(""))
  17. }
  18. }
  19. jar.dependsOn("minimizeTemplate")
  20. jte {
  21. sourceDirectory.set(file("src/main/resources").toPath())
  22. targetDirectory.set(file("build/classes/kotlin/main").toPath())
  23. jteExtension("gg.jte.nativeimage.NativeResourcesExtension")
  24. generate()
  25. }