Relocate packages that could be possibly used in the scripts themselves

#KT-30210 fixed
This commit is contained in:
Ilya Chernikov
2019-03-13 16:23:23 +01:00
parent 91ce7ef5ca
commit 6e55116519
2 changed files with 9 additions and 3 deletions
@@ -7,8 +7,8 @@ plugins {
}
dependencies {
testCompile(project(":kotlin-main-kts"))
testCompile(project(":kotlin-scripting-jvm-host"))
testCompile(projectRuntimeJar(":kotlin-main-kts")) // runtimeJar needed to for proper dependency on the jar with relocations
testCompile(project(":kotlin-scripting-jvm-host-embeddable"))
testCompile(commonDep("junit"))
compileOnly("org.apache.ivy:ivy:2.4.0") // for jps/pill
}
@@ -1,5 +1,4 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
import proguard.gradle.ProGuardTask
description = "Kotlin \"main\" script definition"
@@ -59,6 +58,9 @@ publish()
noDefaultJar()
val mainKtsRootPackage = "org.jetbrains.kotlin.mainKts"
val mainKtsRelocatedDepsRootPackage = "$mainKtsRootPackage.relocatedDeps"
val packJar by task<ShadowJar> {
configurations = listOf(fatJar)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@@ -68,6 +70,10 @@ val packJar by task<ShadowJar> {
from(mainSourceSet.output)
from(fatJarContents)
packagesToRelocate.forEach {
relocate(it, "$mainKtsRelocatedDepsRootPackage.$it")
}
}
val proguard by task<ProGuardTask> {