JS: don't treat library without JS metadata as error, report warning and continue instead. See KT-16158

This commit is contained in:
Alexey Andreev
2017-02-06 12:48:24 +03:00
parent ffca68d85e
commit 9d6f4d7770
3 changed files with 11 additions and 5 deletions
@@ -146,7 +146,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
@Override
public void warning(@NotNull String message) {
messageCollector.report(CompilerMessageSeverity.WARNING, message, CompilerMessageLocation.NO_LOCATION);
messageCollector.report(CompilerMessageSeverity.STRONG_WARNING, message, CompilerMessageLocation.NO_LOCATION);
}
})) {
return COMPILATION_ERROR;
+8 -2
View File
@@ -1,2 +1,8 @@
error: 'compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib' is not a valid Kotlin Javascript library
COMPILATION_ERROR
warning: 'compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib' is not a valid Kotlin Javascript library
compiler/testData/cli/js/withLib.kt:2:8: error: unresolved reference: library
import library.sample.*
^
compiler/testData/cli/js/withLib.kt:6:13: error: unresolved reference: pairAdd
val x = pairAdd(p)
^
COMPILATION_ERROR
@@ -146,8 +146,8 @@ public class LibrarySourcesConfig extends JsConfig {
else {
List<KotlinJavascriptMetadata> metadataList = KotlinJavascriptMetadataUtils.loadMetadata(filePath);
if (metadataList.isEmpty()) {
report.error("'" + path + "' is not a valid Kotlin Javascript library");
return true;
report.warning("'" + path + "' is not a valid Kotlin Javascript library");
continue;
}
for (KotlinJavascriptMetadata metadata : metadataList) {