Skip to content

Commit 545051f

Browse files
committed
Add classes dir of module dependencies to the project's classpath
1 parent 8105c61 commit 545051f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/build/src/main/scala/scala/build/Build.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,10 +990,20 @@ object Build {
990990
List(classesDir(inputs.workspace, inputs.projectName, Scope.Main))
991991
else Nil
992992

993+
// `test` scope should contains class path to main scope
994+
val modulesClassesPath = inputs.moduleDependencies.map { depProjectName =>
995+
classesDir(inputs.workspace, depProjectName, Scope.Main)
996+
} ++ {
997+
if (scope == Scope.Test) inputs.moduleDependencies.map { depProjectName =>
998+
classesDir(inputs.workspace, depProjectName, Scope.Test)
999+
} else Nil
1000+
}
1001+
9931002
value(validate(logger, options))
9941003

9951004
val fullClassPath = artifacts.compileClassPath ++
9961005
mainClassesPath ++
1006+
modulesClassesPath ++
9971007
artifacts.javacPluginDependencies.map(_._3) ++
9981008
artifacts.extraJavacPlugins
9991009

0 commit comments

Comments
 (0)