Make a project-wide embeddedComponents configuration for embedding external binaries to project artifacts

This commit is contained in:
Yan Zhulanow
2018-02-22 21:45:00 +03:00
parent 3c06dd7464
commit 6e65a4810e
9 changed files with 116 additions and 37 deletions
+7 -4
View File
@@ -13,16 +13,19 @@ sourceSets {
"test" {}
}
// Do not rename, used in JPS importer
val fatJarContents by configurations.creating
containsEmbeddedComponents()
dependencies {
projectsToShadow.forEach {p ->
fatJarContents(project(p)) { isTransitive = false }
projectsToShadow.forEach { p ->
embeddedComponents(project(p)) { isTransitive = false }
}
}
runtimeJar {
/*
TODO: `fromEmbeddedComponents()` should be used here.
Couldn't use it because of the "must be locked before it can be used to compute a classpath" error.
*/
projectsToShadow.forEach {
dependsOn("$it:classes")
project(it).let { p ->
-1
View File
@@ -23,7 +23,6 @@ val shrink =
val compilerManifestClassPath =
"kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar"
// Do not rename, used in JPS importer
val fatJarContents by configurations.creating
val fatJarContentsStripMetadata by configurations.creating
+4 -4
View File
@@ -21,20 +21,20 @@ val projectsToShadow = listOf(
":core:util.runtime",
":plugins:android-extensions-jps")
// Do not rename, used in JPS importer
val fatJarContents by configurations.creating
containsEmbeddedComponents()
dependencies {
projectsToShadow.forEach {
fatJarContents(project(it)) { isTransitive = false }
embeddedComponents(project(it)) { isTransitive = false }
}
}
runtimeJar<ShadowJar>(task<ShadowJar>("jar")) {
manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.runner.Main")
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar")
from(fatJarContents)
from(files("$rootDir/resources/kotlinManifest.properties"))
fromEmbeddedComponents()
}
ideaPlugin("lib/jps")