Pack jvm builtins into kotlin-stdlib shipped with idea plugin
This lessens the possibility that kotlin plugin will get different variants of builtins in the classpath, thus making builtins resources loading less order-dependent.
This commit is contained in:
committed by
Dmitry Savvinov
parent
f2cf64aec7
commit
0b5aedb0a2
@@ -11,6 +11,7 @@ configureSourcesJar()
|
|||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
distSources
|
distSources
|
||||||
|
withJvmBuiltins.extendsFrom(configurations.compile)
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -46,6 +47,7 @@ configurations {
|
|||||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR))
|
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
builtinsJvm
|
||||||
compileOnly.extendsFrom(builtins)
|
compileOnly.extendsFrom(builtins)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +62,7 @@ dependencies {
|
|||||||
testCompile project(':kotlin-coroutines-experimental-compat')
|
testCompile project(':kotlin-coroutines-experimental-compat')
|
||||||
|
|
||||||
builtins project(':core:builtins')
|
builtins project(':core:builtins')
|
||||||
|
builtinsJvm project(path: ':core:builtins', configuration: "runtimeElementsJvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
@@ -97,11 +100,26 @@ configureModularJar {
|
|||||||
from zipTree(jar.outputs.files.singleFile)
|
from zipTree(jar.outputs.files.singleFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task withJvmBuiltinsJar(type: Jar) {
|
||||||
|
dependsOn(jar)
|
||||||
|
dependsOn(configurations.builtinsJvm)
|
||||||
|
manifestAttributes(manifest, project, 'Main', true)
|
||||||
|
destinationDirectory = file("$buildDir/lib/with-jvm-builtins")
|
||||||
|
|
||||||
|
from(zipTree(jar.outputs.files.singleFile)) {
|
||||||
|
exclude("**/*.kotlin_builtins")
|
||||||
|
}
|
||||||
|
from {
|
||||||
|
zipTree(configurations.builtinsJvm.singleFile)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
sources sourcesJar
|
sources sourcesJar
|
||||||
distSources distSourcesJar
|
distSources distSourcesJar
|
||||||
archives modularJar
|
archives modularJar
|
||||||
|
withJvmBuiltins withJvmBuiltinsJar
|
||||||
}
|
}
|
||||||
|
|
||||||
DexMethodCountKt.dexMethodCount(project) { task ->
|
DexMethodCountKt.dexMethodCount(project) { task ->
|
||||||
|
|||||||
@@ -172,13 +172,22 @@ dependencies {
|
|||||||
embedded(protobufFull())
|
embedded(protobufFull())
|
||||||
embedded(kotlinBuiltins(forJvm = true))
|
embedded(kotlinBuiltins(forJvm = true))
|
||||||
|
|
||||||
libraries(commonDep(kotlinxCollectionsImmutable()))
|
libraries(project(":kotlin-stdlib", "withJvmBuiltins"))
|
||||||
|
libraries(commonDep(kotlinxCollectionsImmutable())) {
|
||||||
|
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
|
||||||
|
}
|
||||||
libraries(commonDep("javax.inject"))
|
libraries(commonDep("javax.inject"))
|
||||||
libraries(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8"))
|
libraries(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8")) {
|
||||||
libraries(commonDep("org.jetbrains", "markdown"))
|
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
|
||||||
|
}
|
||||||
|
libraries(commonDep("org.jetbrains", "markdown")) {
|
||||||
|
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
|
||||||
|
}
|
||||||
libraries(commonDep("io.javaslang", "javaslang"))
|
libraries(commonDep("io.javaslang", "javaslang"))
|
||||||
|
|
||||||
libraries(kotlinStdlib("jdk8"))
|
libraries(project(":kotlin-stdlib-jdk8")) {
|
||||||
|
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
|
||||||
|
}
|
||||||
|
|
||||||
Platform[193].orHigher {
|
Platform[193].orHigher {
|
||||||
libraries(commonDep("org.jetbrains.intellij.deps.completion", "completion-ranking-kotlin"))
|
libraries(commonDep("org.jetbrains.intellij.deps.completion", "completion-ranking-kotlin"))
|
||||||
|
|||||||
Reference in New Issue
Block a user