Skip to content

Commit

Permalink
Kotlin DSL - 'javafx'
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky authored and qwwdfsad committed Aug 24, 2020
1 parent d8f7d50 commit 4cf1d02
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 34 deletions.
34 changes: 0 additions & 34 deletions ui/kotlinx-coroutines-javafx/build.gradle

This file was deleted.

50 changes: 50 additions & 0 deletions ui/kotlinx-coroutines-javafx/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 4cf1d02

Please sign in to comment.