[K/JS] Add file-to-file compilation ^KT-6168 Fixed

This commit is contained in:
Artem Kobzar
2023-06-22 18:23:45 +00:00
committed by Space Team
parent a44b5e4562
commit 64158a8a2f
74 changed files with 947 additions and 608 deletions
@@ -657,6 +657,13 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
collector.deprecationWarn(irBaseClassInMetadata, false, "-Xir-base-class-in-metadata")
collector.deprecationWarn(irNewIr2Js, true, "-Xir-new-ir2js")
if (irPerFile && moduleKind != MODULE_ES) {
collector.report(
CompilerMessageSeverity.ERROR,
"Per-file compilation can't be used with any `moduleKind` except `es` (ECMAScript Modules)"
)
}
return super.configureAnalysisFlags(collector, languageVersion).also {
it[allowFullyQualifiedNameInKClass] = wasm && wasmKClassFqn //Only enabled WASM BE supports this flag
}
@@ -26,6 +26,10 @@ public interface K2JsArgumentConstants {
String MODULE_UMD = "umd";
String MODULE_ES = "es";
String GRANULARITY_WHOLE_PROGRAM = "whole-program";
String GRANULARITY_PER_MODULE = "per-module";
String GRANULARITY_PER_FILE = "per-file";
String SOURCE_MAP_SOURCE_CONTENT_ALWAYS = "always";
String SOURCE_MAP_SOURCE_CONTENT_NEVER = "never";
String SOURCE_MAP_SOURCE_CONTENT_INLINING = "inlining";