Skip to content

Commit

Permalink
Send dependent projects in GetDependenciesCommand.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeust committed Dec 17, 2015
1 parent 935a9ca commit 733c4b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package com.beust.kobalt.app.remote
import com.beust.kobalt.Args
import com.beust.kobalt.api.IClasspathDependency
import com.beust.kobalt.api.Project
import com.beust.kobalt.api.ProjectDescription
import com.beust.kobalt.app.BuildFileCompiler
import com.beust.kobalt.internal.JvmCompilerPlugin
import com.beust.kobalt.internal.PluginInfo
import com.beust.kobalt.internal.build.BuildFile
import com.beust.kobalt.internal.remote.CommandData
Expand Down Expand Up @@ -55,7 +57,15 @@ class GetDependenciesCommand @Inject constructor(val executors: KobaltExecutors,
allDeps(project.compileDependencies).map { toDependencyData(it, "compile") }
val testDependencies = allDeps(project.testDependencies).map { toDependencyData(it, "testCompile") }

projectDatas.add(ProjectData(project.name, project.directory, compileDependencies, testDependencies,
@Suppress("UNCHECKED_CAST")
val pd = (project.projectProperties.get(JvmCompilerPlugin.DEPENDENT_PROJECTS)
as List<ProjectDescription>)
val dependentProjects = pd.filter { it.project.name == project.name }.flatMap {
it.dependsOn.map { it
.name
}}
projectDatas.add(ProjectData(project.name, project.directory, dependentProjects,
compileDependencies, testDependencies,
project.sourceDirectories, project.sourceDirectoriesTest))
}
log(1, "Returning BuildScriptInfo")
Expand All @@ -70,7 +80,9 @@ class GetDependenciesCommand @Inject constructor(val executors: KobaltExecutors,

class DependencyData(val id: String, val scope: String, val path: String)

class ProjectData(val name: String, val directory: String, val compileDependencies: List<DependencyData>,
class ProjectData(val name: String, val directory: String,
val dependentProjects: List<String>,
val compileDependencies: List<DependencyData>,
val testDependencies: List<DependencyData>, val sourceDirs: Set<String>, val testDirs: Set<String>)

class GetDependenciesData(val projects: List<ProjectData>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class KobaltClient @Inject constructor() : Runnable {
try {
val socket = Socket("localhost", portNumber)
outgoing = PrintWriter(socket.outputStream, true)
val testBuildfile = Paths.get(SystemProperties.homeDir, "kotlin", "kobalt", "kobalt/src/Build.kt")
val testBuildfile = Paths.get(SystemProperties.homeDir, "java/testng/kobalt/src/Build.kt")
.toFile().absolutePath
val c : String = "{ \"name\":\"getDependencies\", \"buildFile\": \"$testBuildfile\"}"
outgoing!!.println(c)
Expand Down

0 comments on commit 733c4b5

Please sign in to comment.