Skip to content

Commit 51b9042

Browse files
committed
use File.pathSeparator for classpath in genDocs and dottydocs
- use File.pathSeparator instead of hard-coded path separator `:` => this way Windows user can run the command as well - reduce code duplication: move classpath string generation to own function and reuse in genDocs and dottydocs
1 parent 771d4c4 commit 51b9042

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

project/Build.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ object Build {
366366

367367
val dottyLib = (packageAll in `dotty-compiler`).value("dotty-library")
368368
val dottyInterfaces = (packageAll in `dotty-compiler`).value("dotty-interfaces")
369-
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":")
369+
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator)
370370
val sources =
371371
(unmanagedSources in (Compile, compile)).value ++
372372
(unmanagedSources in (`dotty-compiler`, Compile)).value
@@ -375,7 +375,7 @@ object Build {
375375
"-project", "Dotty",
376376
"-project-version", dottyVersion,
377377
"-project-url", dottyGithubUrl,
378-
"-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps"
378+
"-classpath", dottyLib + File.pathSeparator + dottyInterfaces + File.pathSeparator + otherDeps
379379
)
380380
(runMain in Compile).toTask(
381381
s""" dotty.tools.dottydoc.Main ${args.mkString(" ")} ${sources.mkString(" ")}"""
@@ -386,8 +386,8 @@ object Build {
386386
val args: Seq[String] = spaceDelimited("<arg>").parsed
387387
val dottyLib = (packageAll in `dotty-compiler`).value("dotty-library")
388388
val dottyInterfaces = (packageAll in `dotty-compiler`).value("dotty-interfaces")
389-
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":")
390-
val cp: Seq[String] = Seq("-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps")
389+
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator)
390+
val cp: Seq[String] = Seq("-classpath", dottyLib + File.pathSeparator + dottyInterfaces + File.pathSeparator + otherDeps)
391391
(runMain in Compile).toTask(s""" dotty.tools.dottydoc.Main ${cp.mkString(" ")} """ + args.mkString(" "))
392392
}.evaluated,
393393

0 commit comments

Comments
 (0)