From 4cf1d02dc979c30be39823473ead6b3a8f14c15b Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Tue, 12 May 2020 20:50:24 +0300 Subject: [PATCH] Kotlin DSL - 'javafx' --- ui/kotlinx-coroutines-javafx/build.gradle | 34 ------------- ui/kotlinx-coroutines-javafx/build.gradle.kts | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 34 deletions(-) delete mode 100644 ui/kotlinx-coroutines-javafx/build.gradle create mode 100644 ui/kotlinx-coroutines-javafx/build.gradle.kts diff --git a/ui/kotlinx-coroutines-javafx/build.gradle b/ui/kotlinx-coroutines-javafx/build.gradle deleted file mode 100644 index 77f1b09650..0000000000 --- a/ui/kotlinx-coroutines-javafx/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ - -plugins { - id 'org.openjfx.javafxplugin' -} - -javafx { - version = javafx_version - modules = ['javafx.controls'] - configuration = 'compile' -} - -task checkJdk8() { - // only fail w/o JDK_18 when actually trying to test, not during project setup phase - doLast { - if (!System.env.JDK_18) { - throw new GradleException("JDK_18 environment variable is not defined. " + - "Can't run JDK 8 compatibility tests. " + - "Please ensure JDK 8 is installed and that JDK_18 points to it.") - } - } -} - -task jdk8Test(type: Test, dependsOn: [compileTestKotlin, checkJdk8]) { - classpath = files { test.classpath } - testClassesDirs = files { test.testClassesDirs } - executable = "$System.env.JDK_18/bin/java" -} - -// Run these tests only during nightly stress test -jdk8Test.onlyIf { project.properties['stressTest'] != null } -build.dependsOn jdk8Test diff --git a/ui/kotlinx-coroutines-javafx/build.gradle.kts b/ui/kotlinx-coroutines-javafx/build.gradle.kts new file mode 100644 index 0000000000..112441e0ed --- /dev/null +++ b/ui/kotlinx-coroutines-javafx/build.gradle.kts @@ -0,0 +1,50 @@ +/* + * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("org.openjfx.javafxplugin") +} + +javafx { + version = version("javafx") + modules = listOf("javafx.controls") + configuration = "compile" +} + +val JDK_18: String? by lazy { + System.getenv("JDK_18") +} + +val checkJdk8 by tasks.registering { + // only fail w/o JDK_18 when actually trying to test, not during project setup phase + doLast { + if (JDK_18 == null) { + throw GradleException( + """ + JDK_18 environment variable is not defined. + Can't run JDK 8 compatibility tests. + Please ensure JDK 8 is installed and that JDK_18 points to it. + """.trimIndent() + ) + } + } +} + +val jdk8Test by tasks.registering(Test::class) { + // Run these tests only during nightly stress test + onlyIf { project.properties["stressTest"] != null } + + val test = tasks.test.get() + + classpath = test.classpath + testClassesDirs = test.testClassesDirs + executable = "$JDK_18/bin/java" + + dependsOn("compileTestKotlin") + dependsOn(checkJdk8) +} + +tasks.build { + dependsOn(jdk8Test) +}