As to shadow plugin (com.github.johnrengelman.shadow), the situation is as follows.
-
in case of using
jvmWithJavatarget, it should work as is, just apply it from the top level of thebuild.gradlescript. Note, hovewer, that the target is going to be deprecated as it’s already said above. -
when using with
jvmtarget, an additional task definition is needed, like the following:task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { def target = kotlin.targets.jvm6 from target.compilations.main.output def runtimeClasspath = target.compilations.main.runtimeDependencyFiles configurations = [runtimeClasspath] }— where
jvm6is the JVM target’s name.So overall
build.gradlewill look like:group 'com.example' version '1.0' buildscript { repositories { jcenter() } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.10' classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2' } } apply plugin: 'kotlin-multiplatform' apply plugin: 'com.github.johnrengelman.shadow' repositories { jcenter() } kotlin { targets { fromPreset(presets.jvm, 'jvm6') } sourceSets { commonMain { dependencies { api 'org.jetbrains.kotlin:kotlin-stdlib-common' } } jvm6Main { dependencies { api 'org.jetbrains.kotlin:kotlin-stdlib' } } } } task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { from kotlin.targets.jvm6.compilations.main.output def runtimeClasspath = kotlin.targets.jvm6.compilations.main.runtimeDependencyFiles configurations = [runtimeClasspath]
The support of kotlin-frontend plugin for JS is in progress right now, you may track the progress via this issue.