{%- if target.enable_preview %} tasks.withType { options.compilerArgs.add("--enable-preview") options.compilerArgs.add("-Xlint:preview") options.release.set({{ jdk_version }}) } tasks.withType { jvmArgs = mutableListOf("--enable-preview") } tasks.withType { jvmArgs = mutableListOf("--enable-preview") environment["JAVA_TOOL_OPTIONS"] = "--enable-preview" } tasks.withType { val javadocOptions = options as CoreJavadocOptions javadocOptions.addStringOption("source", "{{ jdk_version }}") javadocOptions.addBooleanOption("-enable-preview", true) } {% endif -%}