aboutsummaryrefslogtreecommitdiffstats
path: root/build/export_generators/ide-gradle/preview.jinja
blob: 5864b5171ddc6d6a9ad42d942adb49748e01cb7f (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({{ jdk_version }})
}

tasks.withType<JavaExec> {
     jvmArgs = mutableListOf("--enable-preview")
}

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

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