Relocate packages that could be possibly used in the scripts themselves
#KT-30210 fixed
This commit is contained in:
@@ -7,8 +7,8 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(project(":kotlin-main-kts"))
|
testCompile(projectRuntimeJar(":kotlin-main-kts")) // runtimeJar needed to for proper dependency on the jar with relocations
|
||||||
testCompile(project(":kotlin-scripting-jvm-host"))
|
testCompile(project(":kotlin-scripting-jvm-host-embeddable"))
|
||||||
testCompile(commonDep("junit"))
|
testCompile(commonDep("junit"))
|
||||||
compileOnly("org.apache.ivy:ivy:2.4.0") // for jps/pill
|
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 com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
|
|
||||||
import proguard.gradle.ProGuardTask
|
import proguard.gradle.ProGuardTask
|
||||||
|
|
||||||
description = "Kotlin \"main\" script definition"
|
description = "Kotlin \"main\" script definition"
|
||||||
@@ -59,6 +58,9 @@ publish()
|
|||||||
|
|
||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
|
val mainKtsRootPackage = "org.jetbrains.kotlin.mainKts"
|
||||||
|
val mainKtsRelocatedDepsRootPackage = "$mainKtsRootPackage.relocatedDeps"
|
||||||
|
|
||||||
val packJar by task<ShadowJar> {
|
val packJar by task<ShadowJar> {
|
||||||
configurations = listOf(fatJar)
|
configurations = listOf(fatJar)
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
@@ -68,6 +70,10 @@ val packJar by task<ShadowJar> {
|
|||||||
|
|
||||||
from(mainSourceSet.output)
|
from(mainSourceSet.output)
|
||||||
from(fatJarContents)
|
from(fatJarContents)
|
||||||
|
|
||||||
|
packagesToRelocate.forEach {
|
||||||
|
relocate(it, "$mainKtsRelocatedDepsRootPackage.$it")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val proguard by task<ProGuardTask> {
|
val proguard by task<ProGuardTask> {
|
||||||
|
|||||||
Reference in New Issue
Block a user