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 {
560560 value(validate(logger, options))
561561
562562 val project = Project (
563- workspace = inputs.workspace / " .scala" ,
563+ directory = inputs.workspace / " .scala" ,
564+ workspace = inputs.workspace,
564565 classesDir = classesDir0,
565566 scalaCompiler = scalaCompiler,
566567 scalaJsOptions =
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import scala.build.options.Scope
1212
1313final case class Project (
1414 workspace : os.Path ,
15+ directory : os.Path ,
1516 classesDir : os.Path ,
1617 scalaCompiler : ScalaCompiler ,
1718 scalaJsOptions : Option [BloopConfig .JsConfig ],
@@ -47,8 +48,8 @@ final case class Project(
4748 )
4849 baseBloopProject(
4950 projectName,
50- workspace .toNIO,
51- (workspace / " .bloop" / projectName).toNIO,
51+ directory .toNIO,
52+ (directory / " .bloop" / projectName).toNIO,
5253 classesDir.toNIO,
5354 scope
5455 )
@@ -69,7 +70,7 @@ final case class Project(
6970
7071 def writeBloopFile (logger : Logger ): Boolean = {
7172 val bloopFileContent = writeAsJsonToArray(bloopFile)(BloopCodecs .codecFile)
72- val dest = workspace / " .bloop" / s " $projectName.json "
73+ val dest = directory / " .bloop" / s " $projectName.json "
7374 val doWrite = ! os.isFile(dest) || {
7475 val currentContent = os.read.bytes(dest)
7576 ! Arrays .equals(currentContent, bloopFileContent)
Original file line number Diff line number Diff line change @@ -1253,4 +1253,21 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
12531253 expect(p.out.text().trim == " hello" )
12541254 }
12551255 }
1256+
1257+ test(" workspace dir" ) {
1258+ val inputs = TestInputs (
1259+ Seq (
1260+ os.rel / " Hello.scala" ->
1261+ """ |// using lib com.lihaoyi::os-lib:0.7.8
1262+ |
1263+ |object Hello extends App {
1264+ | println(os.pwd)
1265+ |}""" .stripMargin
1266+ )
1267+ )
1268+ inputs.fromRoot { root =>
1269+ val p = os.proc(TestUtil .cli, " Hello.scala" ).call(cwd = root)
1270+ expect(p.out.text().trim == root.toString)
1271+ }
1272+ }
12561273}
You can’t perform that action at this time.
0 commit comments