X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fsource%2FTextualModuleSource.java;h=e0d1c91e4da51e3b6b0b8d583b848857ae9a11b6;hb=bfff906222d6990f2e8af0294fc0840450631949;hp=9a6f4c97fb07c33689e21885a1a641d4bdcadf01;hpb=90b5d2ee1cfe82a75a097116f2f34ddb1cdff067;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/TextualModuleSource.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/TextualModuleSource.java index 9a6f4c97f..e0d1c91e4 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/TextualModuleSource.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/TextualModuleSource.java @@ -69,7 +69,7 @@ public abstract class TextualModuleSource implements ModuleSource { } } - protected ImportDeclaration[] getBuiltinImports(UpdateListener listener) { + public ImportDeclaration[] getBuiltinImports(UpdateListener listener) { return DEFAULT_IMPORTS; } @@ -93,11 +93,14 @@ public abstract class TextualModuleSource implements ModuleSource { if(compiler.getErrorLog().hasNoErrors()) return new Success(compiler.getModule()); else { - LOGGER.error("While compiling " + getModuleName() + ":"); - LOGGER.error(CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors())); + if(options == null || !options.silent) + LOGGER.error("While compiling " + getModuleName() + ":\n " + + CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()).replaceAll("\n", "\n ")); return new Failure(compiler.getErrorLog().getErrors()); } } catch (IOException e) { + if(options == null || !options.silent) + LOGGER.error("Compilation of module " + moduleName + " failed.", e); return new Failure(e); } }