File tree 1 file changed +28
-1
lines changed
ui/kotlinx-coroutines-javafx
1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
2
+ * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
5
5
plugins {
@@ -11,3 +11,30 @@ javafx {
11
11
modules = [ ' javafx.controls' ]
12
12
configuration = ' compile'
13
13
}
14
+
15
+ task checkJdk8 () {
16
+ // only fail w/o JDK_8 when actually trying to compile, not during project setup phase
17
+ doLast {
18
+ if (! System . env. JDK_8 ) {
19
+ throw new GradleException (" JDK_8 environment variable is not defined. " +
20
+ " Can't build against JDK 8 runtime and run JDK 8 compatibility tests. " +
21
+ " Please ensure JDK 8 is installed and that JDK_8 points to it." )
22
+ }
23
+ }
24
+ }
25
+
26
+ tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ) {
27
+ kotlinOptions. jdkHome = System . env. JDK_8
28
+ // only fail when actually trying to compile, not during project setup phase
29
+ dependsOn(checkJdk8)
30
+ }
31
+
32
+ task jdk8Test (type : Test , dependsOn : [compileTestKotlin, checkJdk8]) {
33
+ classpath = files { test. classpath }
34
+ testClassesDirs = files { test. testClassesDirs }
35
+ executable = " $System . env . JDK_8 /bin/java"
36
+ }
37
+
38
+ // Run these tests only during nightly stress test
39
+ jdk8Test. onlyIf { project. properties[' stressTest' ] != null }
40
+ build. dependsOn jdk8Test
You can’t perform that action at this time.
0 commit comments