JS: add -Xmetadata-only flag for JS common code modules (KT-33142 fixed)

This commit is contained in:
Anton Bannykh
2019-09-11 15:58:34 +03:00
parent 6a808ce842
commit ead8379c50
16 changed files with 1140 additions and 89 deletions
@@ -318,9 +318,9 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
AnalyzerWithCompilerReport.Companion.reportDiagnostics(translationResult.getDiagnostics(), messageCollector);
if (!(translationResult instanceof TranslationResult.Success)) return ExitCode.COMPILATION_ERROR;
if (translationResult instanceof TranslationResult.Fail) return ExitCode.COMPILATION_ERROR;
TranslationResult.Success successResult = (TranslationResult.Success) translationResult;
TranslationResult.SuccessBase successResult = (TranslationResult.SuccessBase) translationResult;
OutputFileCollection outputFiles = successResult.getOutputFiles(outputFile, outputPrefixFile, outputPostfixFile);
if (outputFile.isDirectory()) {
@@ -435,6 +435,8 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
configuration.put(JSConfigurationKeys.FRIEND_PATHS, friendPaths);
}
configuration.put(JSConfigurationKeys.METADATA_ONLY, arguments.getMetadataOnly());
String moduleKindName = arguments.getModuleKind();
ModuleKind moduleKind = moduleKindName != null ? moduleKindMap.get(moduleKindName) : ModuleKind.PLAIN;
if (moduleKind == null) {