[JS] Fix JPS artifacts cordinates
This commit is contained in:
committed by
Space Team
parent
1cde8c3624
commit
a79324037d
@@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -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",
|
||||
|
||||
+1
-2
@@ -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")
|
||||
}
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
|
||||
}
|
||||
|
||||
protected open val jsStdlibFile: File
|
||||
get() = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath
|
||||
get() = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibKlibPath
|
||||
|
||||
protected open fun configureAdditionalArgs(args: K2JSCompilerArguments) {
|
||||
args.outputFile = File(outDir, "out.js").canonicalPath
|
||||
|
||||
@@ -41,11 +41,11 @@ enum class KotlinJpsLibrary(val id: String, roots: () -> Array<File>) {
|
||||
|
||||
JsStdLib(
|
||||
"KotlinJavaScript",
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath) }
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibKlibPath) }
|
||||
),
|
||||
JsTest(
|
||||
"KotlinJavaScriptTest",
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsKotlinTestJarPath) }
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsKotlinTestKlibPath) }
|
||||
),
|
||||
Lombok(
|
||||
"lombok",
|
||||
|
||||
@@ -17,12 +17,7 @@
|
||||
package org.jetbrains.kotlin.js.config;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.StandardFileSystems;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.VirtualFileSystem;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.io.URLUtil;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -47,10 +42,10 @@ import static org.jetbrains.kotlin.utils.PathUtil.getKotlinPathsForDistDirectory
|
||||
|
||||
public class JsConfig {
|
||||
public static final List<String> JS_STDLIB =
|
||||
Collections.singletonList(getKotlinPathsForDistDirectory().getJsStdLibJarPath().getAbsolutePath());
|
||||
Collections.singletonList(getKotlinPathsForDistDirectory().getJsStdLibKlibPath().getAbsolutePath());
|
||||
|
||||
public static final List<String> JS_KOTLIN_TEST =
|
||||
Collections.singletonList(getKotlinPathsForDistDirectory().getJsKotlinTestJarPath().getAbsolutePath());
|
||||
Collections.singletonList(getKotlinPathsForDistDirectory().getJsKotlinTestKlibPath().getAbsolutePath());
|
||||
|
||||
public static final String UNKNOWN_EXTERNAL_MODULE_NAME = "<unknown>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user