aboutsummaryrefslogtreecommitdiffstats
path: root/build/export_generators/ide-gradle/preview.jinja
blob: 8e4d55ebdc2832b76eae9f2cb770dd7983776d1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{%- if target.enable_preview %}

tasks.withType<JavaCompile> {
    options.compilerArgs.add("--enable-preview")
    options.compilerArgs.add("-Xlint:preview")
    options.release.set({{ required_jdk }})
}

tasks.withType<JavaExec> {
     jvmArgs?.add("--enable-preview")
}

tasks.withType<Test> {
    jvmArgs?.add("--enable-preview")
    environment["JAVA_TOOL_OPTIONS"] = "--enable-preview"
}

tasks.withType<Javadoc> {
    val javadocOptions = options as CoreJavadocOptions
    javadocOptions.addStringOption("source", "{{ required_jdk }}")
    javadocOptions.addBooleanOption("-enable-preview", true)
}
{% endif -%}