shadow
shadow copied to clipboard
Minimize ditches kotlinx.coroutines Dispatchers.Main JavaFx implementation
Shadow Version
4.0.3
Gradle Version
4.10.1-all
Expected Behavior
Dispatchers.Main from kotlinx.coroutines populated by JavaFx artifact can be used without any issue.
Actual Behavior
Crash when using Dispatchers.Main because the implementation has been removed, so the ServiceLoader doesn't find it.
Gradle Build Script(s)
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") // Version 1.3.11 defined in root build.gradle file
application
id("com.github.johnrengelman.shadow") version "4.0.3"
}
tasks.named<ShadowJar>("shadowJar") {
minimize()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-javafx:1.1.0-alpha")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
application {
mainClassName = "com.example.MyApp"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
The resource file, the referenced class, or both are removed when minimize is enabled, but it shouldn't.