1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Fix test classpath for dependent projects.

This commit is contained in:
Cedric Beust 2016-07-28 02:12:20 -08:00
parent b6cb358606
commit 035bf4a613

View file

@ -183,14 +183,18 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val
return emptyList()
} else {
val result = arrayListOf<IClasspathDependency>()
project.dependsOn.forEach { p ->
KFiles.joinDir(p.directory, p.classesDir(context)).let { classDir ->
// A project is allowed not to have any kobaltBuild/classes directory if it doesn't have
// any sources
if (File(classDir).exists()) {
result.add(FileDependency(KFiles.joinDir(p.directory, p.classesDir(context))))
}
fun maybeAddClassDir(classDir: String) {
// A project is allowed not to have any kobaltBuild/classes or test-classes directory if it doesn't have
// any sources
if (File(classDir).exists()) {
result.add(FileDependency(classDir))
}
}
project.dependsOn.forEach { p ->
maybeAddClassDir(KFiles.joinDir(p.directory, p.classesDir(context)))
maybeAddClassDir(KFiles.makeOutputTestDir(project).path)
val otherDependencies = calculateDependencies(p, context, scopeFilters)
result.addAll(otherDependencies)