[JS IR] stdlib: switch between artifacts rather than artifact content

The switch `includeStdlibJsIr` now affects which artifact is published:
the one with IR or the one without. Previously it affected
whether or not IR was bundled into the artifact "with IR".
This commit is contained in:
Ilya Gorbunov
2019-12-28 04:05:13 +03:00
parent 372a4009bd
commit a9fec21178
2 changed files with 10 additions and 12 deletions
+5 -6
View File
@@ -59,11 +59,10 @@ task libraryJarWithIr(type: Zip, dependsOn: libraryJarWithoutIr) {
duplicatesStrategy DuplicatesStrategy.FAIL
from zipTree(libraryJarWithoutIr.archiveFile)
if (rootProject.includeStdlibJsIr) {
def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateKotlinTestKLib")
dependsOn(irKlib)
from fileTree("${irKlib.outputs.files.singleFile.path}/klib")
}
def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateKotlinTestKLib")
dependsOn(irKlib)
from fileTree("${irKlib.outputs.files.singleFile.path}/klib")
}
task sourcesJar(type: Jar, dependsOn: classes) {
@@ -73,7 +72,7 @@ task sourcesJar(type: Jar, dependsOn: classes) {
artifacts {
runtime libraryJarWithoutIr
archives libraryJarWithIr
archives rootProject.includeStdlibJsIr ? libraryJarWithIr : libraryJarWithoutIr
distLibrary libraryJarWithoutIr
archives sourcesJar
sources sourcesJar
+5 -6
View File
@@ -317,11 +317,10 @@ task libraryJarWithIr(type: Zip, dependsOn: libraryJarWithoutIr) {
duplicatesStrategy DuplicatesStrategy.FAIL
from zipTree(libraryJarWithoutIr.archiveFile)
if (rootProject.includeStdlibJsIr) {
def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateFullRuntimeKLib")
dependsOn(irKlib)
from fileTree("${irKlib.outputs.files.singleFile.path}/klib")
}
def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateFullRuntimeKLib")
dependsOn(irKlib)
from fileTree("${irKlib.outputs.files.singleFile.path}/klib")
}
@@ -371,7 +370,7 @@ task distSourcesJar(type: Jar) {
artifacts {
runtime libraryJarWithoutIr
archives libraryJarWithIr
archives rootProject.includeStdlibJsIr ? libraryJarWithIr : libraryJarWithoutIr
archives sourcesJar
sources sourcesJar
distSources distSourcesJar