Update daemon client with wrappers for basic compiler API
Other changes to extract results for compiler, tests.
This commit is contained in:
+4
-1
@@ -23,6 +23,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -75,7 +76,7 @@ public class OutputMessageUtil {
|
||||
return sourceFiles;
|
||||
}
|
||||
|
||||
public static class Output {
|
||||
public static class Output implements Serializable {
|
||||
@NotNull
|
||||
public final Collection<File> sourceFiles;
|
||||
@Nullable
|
||||
@@ -85,5 +86,7 @@ public class OutputMessageUtil {
|
||||
this.sourceFiles = sourceFiles;
|
||||
this.outputFile = outputFile;
|
||||
}
|
||||
|
||||
static final long serialVersionUID = 0L;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user