[K/JS] Add a secret system property to enable the old Kotlin/JS compiler only for tests until it will be removed from the sources
This commit is contained in:
@@ -55,7 +55,8 @@ enum class CompilerSystemProperties(val property: String, val alwaysDirectAccess
|
|||||||
USER_HOME("user.home", alwaysDirectAccess = true),
|
USER_HOME("user.home", alwaysDirectAccess = true),
|
||||||
JAVA_VERSION("java.specification.version", alwaysDirectAccess = true),
|
JAVA_VERSION("java.specification.version", alwaysDirectAccess = true),
|
||||||
JAVA_HOME("java.home", alwaysDirectAccess = true),
|
JAVA_HOME("java.home", alwaysDirectAccess = true),
|
||||||
JAVA_CLASS_PATH("java.class.path", alwaysDirectAccess = true)
|
JAVA_CLASS_PATH("java.class.path", alwaysDirectAccess = true),
|
||||||
|
KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED("kotlin.js.compiler.legacy.force_enabled", alwaysDirectAccess = true)
|
||||||
;
|
;
|
||||||
|
|
||||||
private fun <T> getProperFunction(custom: T?, default: T): T {
|
private fun <T> getProperFunction(custom: T?, default: T): T {
|
||||||
|
|||||||
+2
-1
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.cli.common.arguments
|
package org.jetbrains.kotlin.cli.common.arguments
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.*
|
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.*
|
||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||||
@@ -365,7 +366,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
|||||||
collector.deprecationWarn(irBaseClassInMetadata, false, "-Xir-base-class-in-metadata")
|
collector.deprecationWarn(irBaseClassInMetadata, false, "-Xir-base-class-in-metadata")
|
||||||
collector.deprecationWarn(irNewIr2Js, true, "-Xir-new-ir2js")
|
collector.deprecationWarn(irNewIr2Js, true, "-Xir-new-ir2js")
|
||||||
|
|
||||||
if (languageVersion >= LanguageVersion.KOTLIN_1_9) {
|
if (languageVersion >= LanguageVersion.KOTLIN_1_9 && CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value != "true") {
|
||||||
collector.deprecationWarn(legacyDeprecatedNoWarn, false, "-Xlegacy-deprecated-no-warn")
|
collector.deprecationWarn(legacyDeprecatedNoWarn, false, "-Xlegacy-deprecated-no-warn")
|
||||||
collector.deprecationWarn(useDeprecatedLegacyCompiler, false, "-Xuse-deprecated-legacy-compiler")
|
collector.deprecationWarn(useDeprecatedLegacyCompiler, false, "-Xuse-deprecated-legacy-compiler")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
|||||||
|
|
||||||
LanguageVersionSettings languageVersionSettings = CommonConfigurationKeysKt.getLanguageVersionSettings(configuration);
|
LanguageVersionSettings languageVersionSettings = CommonConfigurationKeysKt.getLanguageVersionSettings(configuration);
|
||||||
|
|
||||||
if (languageVersionSettings.getLanguageVersion().compareTo(LanguageVersion.KOTLIN_1_9) >= 0) {
|
if (CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.getValue() != "true" && languageVersionSettings.getLanguageVersion().compareTo(LanguageVersion.KOTLIN_1_9) >= 0) {
|
||||||
messageCollector.report(ERROR, "Old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend", null);
|
messageCollector.report(ERROR, "Old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend", null);
|
||||||
return COMPILATION_ERROR;
|
return COMPILATION_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.incremental
|
package org.jetbrains.kotlin.incremental
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||||
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
|
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
|
||||||
import org.jetbrains.kotlin.incremental.utils.TestCompilationResult
|
import org.jetbrains.kotlin.incremental.utils.TestCompilationResult
|
||||||
@@ -43,6 +44,8 @@ abstract class AbstractIncrementalJsCompilerRunnerTest : AbstractIncrementalComp
|
|||||||
sourceMap = true
|
sourceMap = true
|
||||||
metaInfo = true
|
metaInfo = true
|
||||||
useDeprecatedLegacyCompiler = true
|
useDeprecatedLegacyCompiler = true
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open val scopeExpansionMode = CompileScopeExpansionMode.NEVER
|
protected open val scopeExpansionMode = CompileScopeExpansionMode.NEVER
|
||||||
|
|||||||
+3
@@ -6,6 +6,7 @@
|
|||||||
package org.jetbrains.kotlin.incremental
|
package org.jetbrains.kotlin.incremental
|
||||||
|
|
||||||
import org.jetbrains.kotlin.build.report.ICReporter
|
import org.jetbrains.kotlin.build.report.ICReporter
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||||
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistoryJs
|
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistoryJs
|
||||||
@@ -29,6 +30,8 @@ abstract class AbstractIncrementalMultiModuleJsCompilerRunnerTest :
|
|||||||
sourceMap = true
|
sourceMap = true
|
||||||
metaInfo = true
|
metaInfo = true
|
||||||
useDeprecatedLegacyCompiler = true
|
useDeprecatedLegacyCompiler = true
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun makeForSingleModule(
|
override fun makeForSingleModule(
|
||||||
|
|||||||
Vendored
Vendored
@@ -286,13 +286,20 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void doJsTest(@NotNull String fileName) {
|
protected void doJsTest(@NotNull String fileName) {
|
||||||
|
setupOldJsCompiler(fileName);
|
||||||
doTest(fileName, new K2JSCompiler());
|
doTest(fileName, new K2JSCompiler());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doJsDceTest(@NotNull String fileName) {
|
protected void doJsDceTest(@NotNull String fileName) {
|
||||||
|
setupOldJsCompiler(fileName);
|
||||||
doTest(fileName, new K2JSDce());
|
doTest(fileName, new K2JSDce());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupOldJsCompiler(String fileName) {
|
||||||
|
if (fileName == null) return;
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.setValue(Boolean.toString(!fileName.contains("_strict")));
|
||||||
|
}
|
||||||
|
|
||||||
protected void doMetadataTest(@NotNull String fileName) {
|
protected void doMetadataTest(@NotNull String fileName) {
|
||||||
doTest(fileName, new K2MetadataCompiler());
|
doTest(fileName, new K2MetadataCompiler());
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -20,6 +20,7 @@ import com.intellij.openapi.util.io.FileUtil
|
|||||||
import com.intellij.util.io.ZipUtil
|
import com.intellij.util.io.ZipUtil
|
||||||
import org.jetbrains.kotlin.cli.AbstractCliTest
|
import org.jetbrains.kotlin.cli.AbstractCliTest
|
||||||
import org.jetbrains.kotlin.cli.common.CLICompiler
|
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.common.ExitCode
|
||||||
import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||||
@@ -167,6 +168,8 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
|
|||||||
args.add("-output")
|
args.add("-output")
|
||||||
args.add(output.path)
|
args.add(output.path)
|
||||||
args.add("-meta-info")
|
args.add("-meta-info")
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
} else if (compiler is K2JVMCompiler || compiler is K2MetadataCompiler) {
|
} else if (compiler is K2JVMCompiler || compiler is K2MetadataCompiler) {
|
||||||
if (classpath.isNotEmpty()) {
|
if (classpath.isNotEmpty()) {
|
||||||
args.add("-classpath")
|
args.add("-classpath")
|
||||||
|
|||||||
@@ -1205,9 +1205,9 @@ public class CliTestGenerated extends AbstractCliTest {
|
|||||||
runTest("compiler/testData/cli/js/jsHelp.args");
|
runTest("compiler/testData/cli/js/jsHelp.args");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("jsOldBackend.args")
|
@TestMetadata("jsOldBackend_strict.args")
|
||||||
public void testJsOldBackend() throws Exception {
|
public void testJsOldBackend_strict() throws Exception {
|
||||||
runTest("compiler/testData/cli/js/jsOldBackend.args");
|
runTest("compiler/testData/cli/js/jsOldBackend_strict.args");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kotlinHomeWithoutStdlib.args")
|
@TestMetadata("kotlinHomeWithoutStdlib.args")
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.intellij.mock.MockProject
|
|||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
||||||
import org.jetbrains.kotlin.cli.common.CLITool
|
import org.jetbrains.kotlin.cli.common.CLITool
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||||
import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||||
@@ -70,6 +71,12 @@ class AnalysisHandlerExtensionTest : TestCaseWithTmpdir() {
|
|||||||
listOf("-Xuse-deprecated-legacy-compiler", "-output", tmpdir.resolve("out.js").absolutePath)
|
listOf("-Xuse-deprecated-legacy-compiler", "-output", tmpdir.resolve("out.js").absolutePath)
|
||||||
else
|
else
|
||||||
listOf("-d", tmpdir.resolve("out").absolutePath)
|
listOf("-d", tmpdir.resolve("out").absolutePath)
|
||||||
|
|
||||||
|
if (compiler is K2JSCompiler) {
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
|
}
|
||||||
|
|
||||||
val (output, exitCode) = CompilerTestUtil.executeCompiler(compiler, args + outputPath + extras)
|
val (output, exitCode) = CompilerTestUtil.executeCompiler(compiler, args + outputPath + extras)
|
||||||
assertEquals(expectedExitCode, exitCode, output)
|
assertEquals(expectedExitCode, exitCode, output)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.cli
|
|||||||
|
|
||||||
import com.intellij.openapi.util.SystemInfo
|
import com.intellij.openapi.util.SystemInfo
|
||||||
import com.intellij.openapi.util.text.StringUtil
|
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.common.ExitCode
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||||
@@ -142,7 +143,12 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
|
|||||||
runProcess(
|
runProcess(
|
||||||
"kotlinc-js",
|
"kotlinc-js",
|
||||||
"$testDataDirectory/emptyMain.kt",
|
"$testDataDirectory/emptyMain.kt",
|
||||||
"-Xlegacy-deprecated-no-warn", "-Xuse-deprecated-legacy-compiler", "-output", File(tmpdir, "out.js").path
|
"-nowarn",
|
||||||
|
"-Xlegacy-deprecated-no-warn",
|
||||||
|
"-Xuse-deprecated-legacy-compiler",
|
||||||
|
"-D${CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.property}=true",
|
||||||
|
"-output",
|
||||||
|
File(tmpdir, "out.js").path,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-2
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.jvm.compiler
|
|||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil
|
import com.intellij.openapi.util.io.FileUtil
|
||||||
import org.jetbrains.kotlin.cli.common.CLICompiler
|
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.common.ExitCode
|
||||||
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
|
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
|
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
|
||||||
@@ -101,7 +102,13 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
|||||||
|
|
||||||
private fun doTestKotlinLibraryWithWrongMetadataVersionJs(libraryName: String, vararg additionalOptions: String) {
|
private fun doTestKotlinLibraryWithWrongMetadataVersionJs(libraryName: String, vararg additionalOptions: String) {
|
||||||
val library = compileJsLibrary(libraryName, additionalOptions = listOf("-Xmetadata-version=42.0.0"))
|
val library = compileJsLibrary(libraryName, additionalOptions = listOf("-Xmetadata-version=42.0.0"))
|
||||||
compileKotlin("source.kt", File(tmpdir, "usage.js"), listOf(library), K2JSCompiler(), additionalOptions.toList())
|
compileKotlin(
|
||||||
|
"source.kt",
|
||||||
|
File(tmpdir, "usage.js"),
|
||||||
|
listOf(library),
|
||||||
|
K2JSCompiler(),
|
||||||
|
additionalOptions.toList()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doTestPreReleaseKotlinLibrary(
|
private fun doTestPreReleaseKotlinLibrary(
|
||||||
@@ -130,6 +137,11 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
|||||||
else -> throw UnsupportedOperationException(compiler.toString())
|
else -> throw UnsupportedOperationException(compiler.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (compiler is K2JSCompiler) {
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
|
}
|
||||||
|
|
||||||
compileKotlin(
|
compileKotlin(
|
||||||
"source.kt", usageDestination, listOf(result), compiler,
|
"source.kt", usageDestination, listOf(result), compiler,
|
||||||
additionalOptions.toList() + listOf("-language-version", LanguageVersion.LATEST_STABLE.versionString)
|
additionalOptions.toList() + listOf("-language-version", LanguageVersion.LATEST_STABLE.versionString)
|
||||||
@@ -590,7 +602,12 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun testInternalFromForeignModuleJs() {
|
fun testInternalFromForeignModuleJs() {
|
||||||
compileKotlin("source.kt", File(tmpdir, "usage.js"), listOf(compileJsLibrary("library")), K2JSCompiler())
|
compileKotlin(
|
||||||
|
"source.kt",
|
||||||
|
File(tmpdir, "usage.js"),
|
||||||
|
listOf(compileJsLibrary("library")),
|
||||||
|
K2JSCompiler(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testInternalFromFriendModuleJs() {
|
fun testInternalFromFriendModuleJs() {
|
||||||
|
|||||||
+3
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.multiplatform
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.cli.AbstractCliTest
|
import org.jetbrains.kotlin.cli.AbstractCliTest
|
||||||
import org.jetbrains.kotlin.cli.common.CLICompiler
|
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.js.K2JSCompiler
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||||
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler
|
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler
|
||||||
@@ -65,6 +66,8 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
|
|||||||
if (jsSrc != null) {
|
if (jsSrc != null) {
|
||||||
appendLine()
|
appendLine()
|
||||||
appendLine("-- JS --")
|
appendLine("-- JS --")
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-Xuse-deprecated-legacy-compiler", "-output", jsDest!!))
|
appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-Xuse-deprecated-legacy-compiler", "-output", jsDest!!))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
@@ -11,6 +11,7 @@ import com.intellij.util.ThrowableRunnable
|
|||||||
import com.intellij.util.containers.Interner
|
import com.intellij.util.containers.Interner
|
||||||
import org.jetbrains.kotlin.TestWithWorkingDir
|
import org.jetbrains.kotlin.TestWithWorkingDir
|
||||||
import org.jetbrains.kotlin.build.JvmSourceRoot
|
import org.jetbrains.kotlin.build.JvmSourceRoot
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||||
@@ -168,6 +169,8 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
|
|||||||
reportOutputFiles = true
|
reportOutputFiles = true
|
||||||
freeArgs = filesToCompile.map { it.canonicalPath }
|
freeArgs = filesToCompile.map { it.canonicalPath }
|
||||||
useDeprecatedLegacyCompiler = true
|
useDeprecatedLegacyCompiler = true
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
}
|
}
|
||||||
configureAdditionalArgs(args)
|
configureAdditionalArgs(args)
|
||||||
return runJSCompiler(args, env)
|
return runJSCompiler(args, env)
|
||||||
|
|||||||
+2
@@ -27,6 +27,7 @@ import org.jetbrains.jps.model.library.JpsLibrary
|
|||||||
import org.jetbrains.jps.model.library.JpsOrderRootType
|
import org.jetbrains.jps.model.library.JpsOrderRootType
|
||||||
import org.jetbrains.jps.model.library.sdk.JpsSdk
|
import org.jetbrains.jps.model.library.sdk.JpsSdk
|
||||||
import org.jetbrains.jps.util.JpsPathUtil
|
import org.jetbrains.jps.util.JpsPathUtil
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner
|
import org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner
|
||||||
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest
|
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest
|
||||||
import org.jetbrains.kotlin.test.runTest
|
import org.jetbrains.kotlin.test.runTest
|
||||||
@@ -36,6 +37,7 @@ abstract class BaseKotlinJpsBuildTestCase : JpsBuildTestCase() {
|
|||||||
override fun setUp() {
|
override fun setUp() {
|
||||||
super.setUp()
|
super.setUp()
|
||||||
System.setProperty("kotlin.jps.tests", "true")
|
System.setProperty("kotlin.jps.tests", "true")
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun shouldRunTest(): Boolean {
|
override fun shouldRunTest(): Boolean {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.intellij.util.ThrowableRunnable
|
|||||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService
|
import org.jetbrains.jps.model.java.JpsJavaExtensionService
|
||||||
import org.jetbrains.jps.model.module.JpsModule
|
import org.jetbrains.jps.model.module.JpsModule
|
||||||
import org.jetbrains.jps.util.JpsPathUtil
|
import org.jetbrains.jps.util.JpsPathUtil
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||||
import org.jetbrains.kotlin.config.CompilerSettings
|
import org.jetbrains.kotlin.config.CompilerSettings
|
||||||
import org.jetbrains.kotlin.config.KotlinFacetSettings
|
import org.jetbrains.kotlin.config.KotlinFacetSettings
|
||||||
@@ -91,6 +92,8 @@ abstract class KotlinJpsBuildTestBase : AbstractKotlinJpsBuildTestCase() {
|
|||||||
val facet = KotlinFacetSettings()
|
val facet = KotlinFacetSettings()
|
||||||
facet.compilerArguments = K2JSCompilerArguments().apply {
|
facet.compilerArguments = K2JSCompilerArguments().apply {
|
||||||
useDeprecatedLegacyCompiler = true
|
useDeprecatedLegacyCompiler = true
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
}
|
}
|
||||||
facet.targetPlatform = JsPlatforms.defaultJsPlatform
|
facet.targetPlatform = JsPlatforms.defaultJsPlatform
|
||||||
|
|
||||||
|
|||||||
+3
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.jps.incremental
|
package org.jetbrains.kotlin.jps.incremental
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants
|
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants
|
||||||
import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
|
import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
|
||||||
@@ -51,6 +52,8 @@ abstract class AbstractJsProtoComparisonTest : AbstractProtoComparisonTest<Proto
|
|||||||
main = K2JsArgumentConstants.NO_CALL
|
main = K2JsArgumentConstants.NO_CALL
|
||||||
freeArgs = ktFiles
|
freeArgs = ktFiles
|
||||||
useDeprecatedLegacyCompiler = true
|
useDeprecatedLegacyCompiler = true
|
||||||
|
// TODO: It will be deleted after all of our internal vendors will use the new Kotlin/JS compiler
|
||||||
|
CompilerSystemProperties.KOTLIN_JS_COMPILER_LEGACY_FORCE_ENABLED.value = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
val env = createTestingCompilerEnvironment(messageCollector, outputItemsCollector, services)
|
val env = createTestingCompilerEnvironment(messageCollector, outputItemsCollector, services)
|
||||||
|
|||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
kotlin.js.compiler=legacy
|
kotlin.js.compiler=legacy
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
kotlin.js.compiler.nowarn=true
|
kotlin.js.compiler.nowarn=true
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
kotlin.tests.individualTaskReports=true
|
kotlin.tests.individualTaskReports=true
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
kotlin.tests.individualTaskReports=true
|
kotlin.tests.individualTaskReports=true
|
||||||
#because of dependency (kotlinx-html) which is not klib yet
|
#because of dependency (kotlinx-html) which is not klib yet
|
||||||
kotlin.js.compiler=legacy
|
kotlin.js.compiler=legacy
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
kotlin.tests.individualTaskReports=true
|
kotlin.tests.individualTaskReports=true
|
||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.daemon.jvmargs=-Dkotlin.js.compiler.legacy.force_enabled=true
|
||||||
Reference in New Issue
Block a user