Skip to content

Commit ef8f2d9

Browse files
committed
Add classes dir of module dependencies to the project's classpath
1 parent 2e4e025 commit ef8f2d9

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
@@ -985,10 +985,20 @@ object Build {
985985
List(classesDir(inputs.workspace, inputs.projectName, Scope.Main))
986986
else Nil
987987

988+
// `test` scope should contains class path to main scope
989+
val modulesClassesPath = inputs.moduleDependencies.map { depProjectName =>
990+
classesDir(inputs.workspace, depProjectName, Scope.Main)
991+
} ++ {
992+
if (scope == Scope.Test) inputs.moduleDependencies.map { depProjectName =>
993+
classesDir(inputs.workspace, depProjectName, Scope.Test)
994+
} else Nil
995+
}
996+
988997
value(validate(logger, options))
989998

990999
val fullClassPath = artifacts.compileClassPath ++
9911000
mainClassesPath ++
1001+
modulesClassesPath ++
9921002
artifacts.javacPluginDependencies.map(_._3) ++
9931003
artifacts.extraJavacPlugins
9941004

0 commit comments

Comments
 (0)