/** {@inheritDoc} */ @Override public Analysis performCompile(CompilerConfiguration configuration) throws CompilerException { CompilerLogger logger = configuration.getLogger(); SBT012Logger sbtLogger = new SBT012Logger(logger); Setup setup = Setup.create( configuration.getScalaCompilerFile(), configuration.getScalaLibraryFile(), configuration.getScalaExtraJarFiles(), configuration.getXsbtiFile(), configuration.getCompilerInterfaceSrcFile(), null /* , FORK_JAVA */); if (logger.isDebugEnabled()) { Setup.debug(setup, sbtLogger); } Compiler compiler = Compiler.create(setup, sbtLogger); Inputs inputs = Inputs.create( configuration.getClasspathFiles(), configuration.getSourceFiles(), configuration.getOutputDirectory(), resolveScalacOptions(configuration), resolveJavacOptions(configuration), configuration.getAnalysisCacheFile(), configuration.getAnalysisCacheMap(), SBT012Compiler.COMPILE_ORDER, /* getIncOptions(), */ logger.isDebugEnabled() /* mirrorAnalysisCache */); if (configuration.getSourcePositionMapper() != null) { logger.warn("Source position mappers not supported"); } if (logger.isDebugEnabled()) { Inputs.debug(inputs, sbtLogger); } try { return new SBT012Analysis(compiler.compile(inputs, sbtLogger)); } catch (CompileFailed e) { CompilationProblem[] problems = getScalacProblems(e.problems()); if (problems.length == 0) { String[] consoleErrorLines = sbtLogger.getConsoleErrorLines(); problems = getJavacProblems(consoleErrorLines); } throw new CompilerException("Scala compilation failed", e, problems); } }
@Override public Analysis performCompile(CompilerConfiguration configuration) throws CompilerException { Logger sbtLogger = new SBT0131Logger(configuration.getLogger()); Setup setup = Setup.create( configuration.getScalaCompilerFile(), configuration.getScalaLibraryFile(), configuration.getScalaExtraJarFiles(), configuration.getXsbtiFile(), configuration.getCompilerInterfaceSrcFile(), null, SBT0131Compiler.FORK_JAVA); if (configuration.getLogger().isDebugEnabled()) { Setup.debug(setup, sbtLogger); } Compiler compiler = Compiler.create(setup, sbtLogger); Inputs inputs = Inputs.create( configuration.getClasspathFiles(), configuration.getSourceFiles(), configuration.getOutputDirectory(), resolveScalacOptions(configuration), resolveJavacOptions(configuration), configuration.getAnalysisCacheFile(), configuration.getAnalysisCacheMap(), SBT0131Compiler.COMPILE_ORDER, getIncOptions(), false /* mirrorAnalysisCache */); if (configuration.getLogger().isDebugEnabled()) { Inputs.debug(inputs, sbtLogger); } try { return new SBT0131Analysis(compiler.compile(inputs, sbtLogger)); } catch (CompileFailed e) { throw new CompilerException("Scala compilation failed", e); } }