|
1 | 1 | /*
|
2 |
| - * Copyright 2016-2019 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 | import org.jetbrains.kotlin.konan.target.HostManager
|
5 | 5 |
|
@@ -68,6 +68,7 @@ buildscript {
|
68 | 68 | classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
|
69 | 69 | classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version"
|
70 | 70 | classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version"
|
| 71 | + classpath "org.openjfx:javafx-plugin:$javafx_plugin_version" |
71 | 72 | classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binary_compatibility_validator_version"
|
72 | 73 |
|
73 | 74 | // JMH plugins
|
@@ -261,8 +262,26 @@ configure(subprojects.findAll { !unpublished.contains(it.name) }) {
|
261 | 262 | // Report Kotlin compiler version when building project
|
262 | 263 | println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION")
|
263 | 264 |
|
| 265 | +// --------------- Publish only from under JDK11+ --------------- |
| 266 | +task checkJdkForPublish { |
| 267 | + doFirst { |
| 268 | + String javaVersion = System.properties["java.version"] |
| 269 | + int i = javaVersion.indexOf('.') |
| 270 | + int javaVersionMajor = (i < 0 ? javaVersion : javaVersion.substring(0, i)).toInteger() |
| 271 | + if (javaVersionMajor < 11) { |
| 272 | + throw new GradleException("Project can be build for publishing only under JDK 11+, but found ${javaVersion}") |
| 273 | + } |
| 274 | + } |
| 275 | +} |
| 276 | + |
264 | 277 | // --------------- Configure sub-projects that are published ---------------
|
265 |
| -task deploy(dependsOn: getTasksByName("publish", true) + getTasksByName("publishNpm", true)) |
| 278 | +def publishTasks = getTasksByName("publish", true) + getTasksByName("publishNpm", true) |
| 279 | + |
| 280 | +publishTasks.each { |
| 281 | + it.dependsOn checkJdkForPublish |
| 282 | +} |
| 283 | + |
| 284 | +task deploy(dependsOn: publishTasks) |
266 | 285 |
|
267 | 286 | apply plugin: 'base'
|
268 | 287 |
|
|
0 commit comments