diff --git a/src/main/kotlin/com/beust/kobalt/internal/build/BuildFileCompiler.kt b/src/main/kotlin/com/beust/kobalt/internal/build/BuildFileCompiler.kt index 41ce498d..12dfa7b8 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/build/BuildFileCompiler.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/build/BuildFileCompiler.kt @@ -8,14 +8,12 @@ import com.beust.kobalt.api.KobaltContext import com.beust.kobalt.api.PluginProperties import com.beust.kobalt.api.Project import com.beust.kobalt.internal.PluginInfo -import com.beust.kobalt.internal.build.VersionFile import com.beust.kobalt.maven.DependencyManager import com.beust.kobalt.misc.KFiles import com.beust.kobalt.misc.KobaltExecutors import com.beust.kobalt.misc.log import com.beust.kobalt.plugin.kotlin.kotlinCompilePrivate import com.google.inject.assistedinject.Assisted -import rx.subjects.PublishSubject import java.io.File import java.net.URL import java.nio.file.Paths @@ -35,8 +33,6 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b fun create(@Assisted("buildFiles") buildFiles: List, pluginInfo: PluginInfo) : BuildFileCompiler } - val observable = PublishSubject.create>() - private val SCRIPT_JAR = "buildScript.jar" fun compileBuildFiles(args: Args): List { @@ -115,12 +111,6 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b * - the source code for the modified Build.kt (after profiles are applied) * - the URL's of all the plug-ins that were found. */ - private fun parseBuildFile(context: KobaltContext, buildFile: BuildFile) : ParsedBuildFile { - // Parse the build file so we can generate preBuildScript and buildScript from it. - with(ParsedBuildFile(buildFile, context, buildScriptUtil, dependencyManager, files)) { - // Notify possible listeners (e.g. KobaltServer) we now have all the projects - observable.onNext(projects) - return this - } - } + private fun parseBuildFile(context: KobaltContext, buildFile: BuildFile) = + ParsedBuildFile(buildFile, context, buildScriptUtil, dependencyManager, files) } diff --git a/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt b/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt index 6dbb49d6..4c07493f 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt @@ -30,12 +30,8 @@ class GetDependenciesCommand @Inject constructor(val executors: KobaltExecutors, override fun run(sender: ICommandSender, received: JsonObject) { val buildFile = BuildFile(Paths.get(received.get("buildFile").asString), "GetDependenciesCommand") val scriptCompiler = buildFileCompilerFactory.create(listOf(buildFile), pluginInfo) - scriptCompiler.observable.subscribe { - projects -> if (projects.size > 0) { - sender.sendData(toData(projects)) - } - } - scriptCompiler.compileBuildFiles(args) + val projects = scriptCompiler.compileBuildFiles(args) + sender.sendData(toData(projects)) } private fun toData(projects: List) : CommandData {