summaryrefslogtreecommitdiff
path: root/plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/incremental/compilerUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/incremental/compilerUtils.kt')
-rw-r--r--plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/incremental/compilerUtils.kt52
1 files changed, 0 insertions, 52 deletions
diff --git a/plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/incremental/compilerUtils.kt b/plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/incremental/compilerUtils.kt
deleted file mode 100644
index ae8eb1c420ce..000000000000
--- a/plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/incremental/compilerUtils.kt
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-
-package org.jetbrains.kotlin.jps.incremental
-
-import org.jetbrains.kotlin.cli.common.ExitCode
-import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
-import org.jetbrains.kotlin.cli.common.messages.MessageCollector
-import org.jetbrains.kotlin.cli.js.K2JSCompiler
-import org.jetbrains.kotlin.compilerRunner.*
-import org.jetbrains.kotlin.config.Services
-import org.jetbrains.kotlin.jps.build.KotlinBuilder
-import java.io.BufferedReader
-import java.io.ByteArrayOutputStream
-import java.io.PrintStream
-import java.io.StringReader
-
-fun createTestingCompilerEnvironment(
- messageCollector: MessageCollector,
- outputItemsCollector: OutputItemsCollectorImpl,
- services: Services
-): JpsCompilerEnvironment {
- val wrappedMessageCollector = MessageCollectorToOutputItemsCollectorAdapter(messageCollector, outputItemsCollector)
- return JpsCompilerEnvironment(
- services,
- KotlinBuilder.classesToLoadByParent,
- wrappedMessageCollector,
- outputItemsCollector,
- MockProgressReporter
- )
-}
-
-fun runJSCompiler(args: K2JSCompilerArguments, env: JpsCompilerEnvironment): ExitCode? {
- val argsArray = ArgumentUtils.convertArgumentsToStringList(args).toTypedArray()
-
- val stream = ByteArrayOutputStream()
- val out = PrintStream(stream)
- val exitCode = CompilerRunnerUtil.invokeExecMethod(K2JSCompiler::class.java.name, argsArray, env, out)
- val reader = BufferedReader(StringReader(stream.toString()))
- CompilerOutputParser.parseCompilerMessagesFromReader(env.messageCollector, reader, env.outputItemsCollector)
- return exitCode as? ExitCode
-}
-
-private object MockProgressReporter : ProgressReporter {
- override fun progress(message: String) {
- }
-
- override fun compilationStarted() {
- }
-
- override fun clearProgress() {
- }
-} \ No newline at end of file