From 9e4d7df86e85f3fa62cdf9cbe1e909f6457ffde1 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 10 Jan 2020 21:24:43 +0300 Subject: [PATCH] Revert "[JS IR] stdlib: switch between artifacts rather than artifact content" The default Jar task is disabled, but its archive file is still configured as an artifact to be published in the 'archives' configuration. Thus, neither 'install', nor 'publish' tasks could not find this file when `libraryJarWithIr` isn't triggered and does not build it. Removing that artifact from the 'archives' configuration artifacts makes 'install' task publish nothing. Therefore it's better to revert the change so that 'libraryJarWithIr' task always runs and produces an artifact with the default name. This reverts commit a9fec211 --- libraries/kotlin.test/js/build.gradle | 11 ++++++----- libraries/stdlib/js-v1/build.gradle | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/libraries/kotlin.test/js/build.gradle b/libraries/kotlin.test/js/build.gradle index a5fbefec7ba..891209eace3 100644 --- a/libraries/kotlin.test/js/build.gradle +++ b/libraries/kotlin.test/js/build.gradle @@ -59,10 +59,11 @@ task libraryJarWithIr(type: Zip, dependsOn: libraryJarWithoutIr) { duplicatesStrategy DuplicatesStrategy.FAIL from zipTree(libraryJarWithoutIr.archiveFile) - - def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateKotlinTestKLib") - dependsOn(irKlib) - from fileTree("${irKlib.outputs.files.singleFile.path}/klib") + if (rootProject.includeStdlibJsIr) { + 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) { @@ -72,7 +73,7 @@ task sourcesJar(type: Jar, dependsOn: classes) { artifacts { runtime libraryJarWithoutIr - archives rootProject.includeStdlibJsIr ? libraryJarWithIr : libraryJarWithoutIr + archives libraryJarWithIr distLibrary libraryJarWithoutIr archives sourcesJar sources sourcesJar diff --git a/libraries/stdlib/js-v1/build.gradle b/libraries/stdlib/js-v1/build.gradle index 1ab52650ea1..c5695da6647 100644 --- a/libraries/stdlib/js-v1/build.gradle +++ b/libraries/stdlib/js-v1/build.gradle @@ -317,10 +317,11 @@ task libraryJarWithIr(type: Zip, dependsOn: libraryJarWithoutIr) { duplicatesStrategy DuplicatesStrategy.FAIL from zipTree(libraryJarWithoutIr.archiveFile) - - def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateFullRuntimeKLib") - dependsOn(irKlib) - from fileTree("${irKlib.outputs.files.singleFile.path}/klib") + if (rootProject.includeStdlibJsIr) { + def irKlib = tasks.getByPath(":kotlin-stdlib-js-ir:generateFullRuntimeKLib") + dependsOn(irKlib) + from fileTree("${irKlib.outputs.files.singleFile.path}/klib") + } } @@ -370,7 +371,7 @@ task distSourcesJar(type: Jar) { artifacts { runtime libraryJarWithoutIr - archives rootProject.includeStdlibJsIr ? libraryJarWithIr : libraryJarWithoutIr + archives libraryJarWithIr archives sourcesJar sources sourcesJar distSources distSourcesJar