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

Better test classpath.

This commit is contained in:
Cedric Beust 2016-02-28 11:41:09 -08:00
parent 66c349121c
commit 136db52cb2

View file

@ -122,8 +122,6 @@ public class DependencyManager @Inject constructor(val executors: KobaltExecutor
: List<IClasspathDependency> { : List<IClasspathDependency> {
val result = arrayListOf<IClasspathDependency>() val result = arrayListOf<IClasspathDependency>()
val projects = listOf(ProjectDescription(project, project.projectExtra.dependsOn)) val projects = listOf(ProjectDescription(project, project.projectExtra.dependsOn))
result.add(FileDependency(KFiles.makeOutputDir(project).absolutePath))
result.add(FileDependency(KFiles.makeOutputTestDir(project).absolutePath))
with(project) { with(project) {
val deps = arrayListOf(compileDependencies, compileProvidedDependencies) val deps = arrayListOf(compileDependencies, compileProvidedDependencies)
if (isTest) { if (isTest) {
@ -134,7 +132,12 @@ public class DependencyManager @Inject constructor(val executors: KobaltExecutor
result.addAll(calculateDependencies(project, context, projects, it)) result.addAll(calculateDependencies(project, context, projects, it))
} }
} }
val result2 = reorderDependencies(result)
// Make sure that classes/ and test-classes/ are always at the top of this classpath,
// so that older versions of that project on the classpath don't shadow them
val result2 = arrayListOf(FileDependency(KFiles.makeOutputDir(project).absolutePath),
FileDependency(KFiles.makeOutputTestDir(project).absolutePath)) +
reorderDependencies(result)
return result2 return result2
} }