• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
<lambda>null5 plugins {
6     id("org.openjfx.javafxplugin") version "0.0.9"
7 }
8 
<lambda>null9 configurations {
10     register("javafx")
11     named("compileOnly") {
12         extendsFrom(configurations["javafx"])
13     }
14     named("testImplementation") {
15         extendsFrom(configurations["javafx"])
16     }
17 }
18 
<lambda>null19 javafx {
20     version = version("javafx")
21     modules = listOf("javafx.controls")
22     configuration = "javafx"
23 }
24 
<lambda>null25 val JDK_18: String? by lazy {
26     System.getenv("JDK_18")
27 }
28 
<lambda>null29 val checkJdk8 by tasks.registering {
30     // only fail w/o JDK_18 when actually trying to test, not during project setup phase
31     doLast {
32         if (JDK_18 == null) {
33             throw GradleException(
34                 """
35                 JDK_18 environment variable is not defined.
36                 Can't run JDK 8 compatibility tests.
37                 Please ensure JDK 8 is installed and that JDK_18 points to it.
38                 """.trimIndent()
39             )
40         }
41     }
42 }
43 
<lambda>null44 val jdk8Test by tasks.registering(Test::class) {
45     // Run these tests only during nightly stress test
46     onlyIf { project.properties["stressTest"] != null }
47 
48     val test = tasks.test.get()
49 
50     classpath = test.classpath
51     testClassesDirs = test.testClassesDirs
52     executable = "$JDK_18/bin/java"
53 
54     dependsOn("compileTestKotlin")
55     dependsOn(checkJdk8)
56 }
57 
<lambda>null58 tasks.build {
59     dependsOn(jdk8Test)
60 }
61