[JS] Fix JPS artifacts cordinates

This commit is contained in:
Ilya Goncharov
2023-09-20 13:43:04 +02:00
committed by Space Team
parent 1cde8c3624
commit a79324037d
9 changed files with 18 additions and 22 deletions
@@ -512,7 +512,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
List<String> libraries = new SmartList<>();
if (!arguments.getNoStdlib()) {
File stdlibJar = getLibraryFromHome(
paths, KotlinPaths::getJsStdLibJarPath, PathUtil.JS_LIB_JAR_NAME, messageCollector, "'-no-stdlib'");
paths, KotlinPaths::getJsStdLibKlibPath, PathUtil.JS_LIB_JAR_NAME, messageCollector, "'-no-stdlib'");
if (stdlibJar != null) {
libraries.add(stdlibJar.getAbsolutePath());
}
@@ -299,7 +299,7 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir {
KtTestUtil.getJdk17Home().getPath()
).replace(
"$STDLIB_JS$",
PathUtil.getKotlinPathsForCompiler().getJsStdLibJarPath().getAbsolutePath()
PathUtil.getKotlinPathsForCompiler().getJsStdLibKlibPath().getAbsolutePath()
);
}
@@ -20,7 +20,6 @@ import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.io.ZipUtil
import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.cli.common.CLICompiler
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
import org.jetbrains.kotlin.cli.common.ExitCode
import org.jetbrains.kotlin.cli.js.K2JSCompiler
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
@@ -166,7 +165,7 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
if (compiler is K2JSCompiler) {
args.add("-libraries")
args.add((classpath + PathUtil.kotlinPathsForCompiler.jsStdLibJarPath).joinToString(File.pathSeparator))
args.add((classpath + PathUtil.kotlinPathsForCompiler.jsStdLibKlibPath).joinToString(File.pathSeparator))
args.add("-Xir-produce-klib-dir")
args.add("-Xir-only")
args.add("-ir-output-dir")
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.cli
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
import org.jetbrains.kotlin.cli.common.ExitCode
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
import org.jetbrains.kotlin.test.CompilerTestUtil
@@ -146,7 +145,7 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
"$testDataDirectory/emptyMain.kt",
"-nowarn",
"-libraries",
PathUtil.kotlinPathsForCompiler.jsStdLibJarPath.absolutePath,
PathUtil.kotlinPathsForCompiler.jsStdLibKlibPath.absolutePath,
"-Xir-produce-klib-dir",
"-Xir-only",
"-ir-output-dir",
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.multiplatform
import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.cli.common.CLICompiler
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
import org.jetbrains.kotlin.cli.js.K2JSCompiler
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler
@@ -74,7 +73,7 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
"-Xir-produce-klib-dir",
"-Xir-only",
"-libraries",
PathUtil.kotlinPathsForCompiler.jsStdLibJarPath.absolutePath,
PathUtil.kotlinPathsForCompiler.jsStdLibKlibPath.absolutePath,
"-ir-output-dir",
jsDest!!,
"-ir-output-name",
@@ -47,16 +47,16 @@ interface KotlinPaths {
get() = sourcesJar(Jar.StdLib)!!
// @Deprecated("Obsolete API", ReplaceWith("jar(KotlinPaths.Jars.jsStdLib)"))
val jsStdLibJarPath: File
get() = jar(Jar.JsStdLib)
val jsStdLibKlibPath: File
get() = klib(Jar.JsStdLib)
// @Deprecated("Obsolete API", ReplaceWith("sourcesJar(KotlinPaths.Jars.JsStdLib)!!"))
val jsStdLibSrcJarPath: File
get() = sourcesJar(Jar.JsStdLib)!!
// @Deprecated("Obsolete API", ReplaceWith("jar(KotlinPaths.Jars.jsKotlinTest)"))
val jsKotlinTestJarPath: File
get() = jar(Jar.JsKotlinTest)
val jsKotlinTestKlibPath: File
get() = klib(Jar.JsKotlinTest)
// @Deprecated("Obsolete API", ReplaceWith("jar(KotlinPaths.Jars.allOpenPlugin)"))
val allOpenPluginJarPath: File
@@ -132,6 +132,8 @@ interface KotlinPaths {
fun jar(jar: Jar): File
fun klib(jar: Jar): File
fun sourcesJar(jar: Jar): File?
fun classPath(jars: Sequence<Jar>): List<File> = jars.map(this::jar).toList()
@@ -153,5 +155,7 @@ open class KotlinPathsFromBaseDirectory(val basePath: File) : KotlinPaths {
override fun jar(jar: KotlinPaths.Jar): File = basePath.resolve(jar.baseName + ".jar")
override fun klib(jar: KotlinPaths.Jar): File = basePath.resolve(jar.baseName + ".klib")
override fun sourcesJar(jar: KotlinPaths.Jar): File? = basePath.resolve(jar.baseName + "-sources.jar")
}