Update daemon client with wrappers for basic compiler API

Other changes to extract results for compiler, tests.
This commit is contained in:
Ilya Chernikov
2017-01-16 16:49:30 +01:00
parent afd0655776
commit ec7e8873f4
10 changed files with 356 additions and 64 deletions
@@ -86,14 +86,16 @@ object KotlinToJVMBytecodeCompiler {
mainClass: FqName?
) {
val jarPath = configuration.get(JVMConfigurationKeys.OUTPUT_JAR)
val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
if (jarPath != null) {
val includeRuntime = configuration.get(JVMConfigurationKeys.INCLUDE_RUNTIME, false)
CompileEnvironmentUtil.writeToJar(jarPath, includeRuntime, mainClass, outputFiles)
messageCollector.report(CompilerMessageSeverity.OUTPUT,
OutputMessageUtil.formatOutputMessage(outputFiles.asList().flatMap { it.sourceFiles }.distinct(), jarPath), CompilerMessageLocation.NO_LOCATION)
return
}
val outputDir = configuration.get(JVMConfigurationKeys.OUTPUT_DIRECTORY) ?: File(".")
val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
outputFiles.writeAll(outputDir, messageCollector)
}