File tree 3 files changed +24
-4
lines changed
build/src/main/scala/scala/build
integration/src/test/scala/scala/cli/integration
3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -1004,6 +1004,10 @@ object Build {
1004
1004
else Nil
1005
1005
}
1006
1006
1007
+ val moduleDeps = inputs.moduleDependencies ++ {
1008
+ if (scope == Scope .Test ) Seq (inputs.scopeProjectName(Scope .Main )) else Nil
1009
+ }
1010
+
1007
1011
value(validate(logger, options))
1008
1012
1009
1013
val fullClassPath = artifacts.compileClassPath ++
@@ -1036,7 +1040,7 @@ object Build {
1036
1040
scope = scope,
1037
1041
javaHomeOpt = Option (options.javaHomeLocation().value),
1038
1042
javacOptions = javacOptions,
1039
- moduleDependencies = inputs.moduleDependencies
1043
+ moduleDependencies = moduleDeps
1040
1044
)
1041
1045
project
1042
1046
}
Original file line number Diff line number Diff line change @@ -333,7 +333,22 @@ final class BspImpl(
333
333
executor
334
334
)
335
335
336
- preBuild.thenCompose {
336
+ preBuild.thenCompose { x =>
337
+ Thread .sleep(1000 )
338
+ x.foreach{ r =>
339
+ r.prebuildModules.foreach{ m =>
340
+ pprint.err.log(m.mainScope.project.projectName)
341
+ m.mainScope.sources.paths.foreach(path => pprint.err.log(os.read(path._1)))
342
+ m.mainScope.project.classPath.foreach(p => pprint.err.log(p.toString))
343
+ }
344
+ r.prebuildModules.foreach { m =>
345
+ pprint.err.log(m.testScope.project.projectName)
346
+ m.testScope.sources.paths.foreach(path => pprint.err.log(os.read(path._1)))
347
+ m.testScope.project.classPath.foreach(p => pprint.err.log(p.toString))
348
+ }
349
+ }
350
+ CompletableFuture .supplyAsync(() => x, executor)
351
+ }.thenCompose {
337
352
case Left ((ex, projectName)) =>
338
353
val taskId = new b.TaskId (UUID .randomUUID().toString)
339
354
Original file line number Diff line number Diff line change 1
1
package scala .cli .integration
2
2
3
- import ch .epfl .scala .bsp4j .{BuildTargetEvent , JvmTestEnvironmentParams , SourcesParams }
3
+ import ch .epfl .scala .bsp4j .{BuildTargetEvent , JvmTestEnvironmentParams }
4
4
import ch .epfl .scala .bsp4j as b
5
5
import com .eed3si9n .expecty .Expecty .expect
6
6
import com .google .gson .{Gson , JsonElement }
7
7
8
8
import java .net .URI
9
9
import java .nio .file .Paths
10
10
import java .util .concurrent .{ExecutorService , ScheduledExecutorService }
11
+
11
12
import scala .annotation .tailrec
12
13
import scala .async .Async .{async , await }
13
14
import scala .cli .integration .compose .ComposeBspTestDefinitions
@@ -778,7 +779,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite with TestScalaVersionArg
778
779
}
779
780
}
780
781
781
- test(" tes scope uses artifacts from main scope" ) {
782
+ test(" test workspace update after adding file to main scope" ) {
782
783
val inputs = TestInputs (
783
784
os.rel / " Messages.scala" ->
784
785
""" //> using dep "com.lihaoyi::os-lib:0.7.8"
You can’t perform that action at this time.
0 commit comments