Skip to content

1.8.0

Compare
Choose a tag to compare
@casid casid released this 28 Feb 17:04

This release adds the optional jte-kotlin module.

It can compile .kte template files, which use Kotlin instead of Java as expression language. See #57 for more background information.

This is how the example.jte file from the front page looks like as example.kte:

@import org.example.Page

@param page:Page

<head>
    @if(page.description != null)
        <meta name="description" content="${page.description}">
    @endif
    <title>${page.title}</title>
</head>
<body>
    <h1>${page.title}</h1>
    <p>Welcome to my example page!</p>
</body>

To compile templates with Kotlin as expression language, you need to add the jte-kotlin module to your project:

<dependency>
    <groupId>gg.jte</groupId>
    <artifactId>jte-kotlin</artifactId>
    <version>1.8.0</version>
</dependency>

Since 1.8.0 both Maven and Gradle plugins can precompile jte and kte files. You can seamlessly call jte templates from kte templates and vice versa. This might be handy if you'd like to migrate the expression language of existing jte templates from Java to Kotlin.

The IntelliJ plugin is pretty far already to support kte files (https://github.com/casid/jte-intellij/tree/kotlin-support). There's still one issue with unresolved backwards references. If anyone has an idea why this doesn't work with Kotlin injections (https://intellij-support.jetbrains.com/hc/en-us/community/posts/360008349720-Kotlin-references-in-MultiHostInjector-are-not-working-correctly), I'm very happy about any hint :-) Regardless there's gonna be a first beta release of the IntelliJ plugin with Kotlin support next week!

Other bugfixes and improvements:

  • #63 package name of template classes can be specified
  • #63 better hot reload experience with generated template sources
  • #60 Gradle plugin no longer includes source sets which caused problems on some builds
  • #52 Fix hasTemplate method with DirectoryCodeResolver