File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
build/src/main/scala/scala/build
integration/src/test/scala/scala/cli/integration Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -560,7 +560,8 @@ object Build {
560
560
value(validate(logger, options))
561
561
562
562
val project = Project (
563
- workspace = inputs.workspace / " .scala" ,
563
+ directory = inputs.workspace / " .scala" ,
564
+ workspace = inputs.workspace,
564
565
classesDir = classesDir0,
565
566
scalaCompiler = scalaCompiler,
566
567
scalaJsOptions =
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import scala.build.options.Scope
12
12
13
13
final case class Project (
14
14
workspace : os.Path ,
15
+ directory : os.Path ,
15
16
classesDir : os.Path ,
16
17
scalaCompiler : ScalaCompiler ,
17
18
scalaJsOptions : Option [BloopConfig .JsConfig ],
@@ -47,8 +48,8 @@ final case class Project(
47
48
)
48
49
baseBloopProject(
49
50
projectName,
50
- workspace .toNIO,
51
- (workspace / " .bloop" / projectName).toNIO,
51
+ directory .toNIO,
52
+ (directory / " .bloop" / projectName).toNIO,
52
53
classesDir.toNIO,
53
54
scope
54
55
)
@@ -69,7 +70,7 @@ final case class Project(
69
70
70
71
def writeBloopFile (logger : Logger ): Boolean = {
71
72
val bloopFileContent = writeAsJsonToArray(bloopFile)(BloopCodecs .codecFile)
72
- val dest = workspace / " .bloop" / s " $projectName.json "
73
+ val dest = directory / " .bloop" / s " $projectName.json "
73
74
val doWrite = ! os.isFile(dest) || {
74
75
val currentContent = os.read.bytes(dest)
75
76
! Arrays .equals(currentContent, bloopFileContent)
Original file line number Diff line number Diff line change @@ -1234,4 +1234,21 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
1234
1234
expect(p.out.text().trim == " hello" )
1235
1235
}
1236
1236
}
1237
+
1238
+ test(" workspace dir" ) {
1239
+ val inputs = TestInputs (
1240
+ Seq (
1241
+ os.rel / " Hello.scala" ->
1242
+ """ |// using lib com.lihaoyi::os-lib:0.7.8
1243
+ |
1244
+ |object Hello extends App {
1245
+ | println(os.pwd)
1246
+ |}""" .stripMargin
1247
+ )
1248
+ )
1249
+ inputs.fromRoot { root =>
1250
+ val p = os.proc(TestUtil .cli, " Hello.scala" ).call(cwd = root)
1251
+ expect(p.out.text().trim == root.toString)
1252
+ }
1253
+ }
1237
1254
}
You can’t perform that action at this time.
0 commit comments