JS: don't treat library without JS metadata as error, report warning and continue instead. See KT-16158
This commit is contained in:
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user