Skip to content

Commit 4236369

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
1 parent 771d4c4 commit 4236369

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

project/Build.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ object Build {
345345
javacOptions in (Compile, doc) --= Seq("-Xlint:unchecked", "-Xlint:deprecation")
346346
)
347347

348-
// Settings shared between dotty-doc and dotty-doc-bootstrapped
348+
// Settings shared between dotty-doc and dotty-doc-bootstrapped
349349
lazy val dottyDocSettings = Seq(
350350
baseDirectory in (Compile, run) := baseDirectory.value / "..",
351351
baseDirectory in Test := baseDirectory.value / "..",
@@ -362,11 +362,12 @@ object Build {
362362
// Make majorVersion available at dotty.epfl.ch/versions/latest-nightly-base
363363
// Used by sbt-dotty to resolve the latest nightly
364364
val majorVersion = baseVersion.take(baseVersion.lastIndexOf('.'))
365-
IO.write(file("./docs/_site/versions/latest-nightly-base"), majorVersion)
365+
IO.write(file("./docs/_site/versions/latest-nightly-base"), majorVersion)
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)
370+
val docClasspath = dottyLib + File.pathSeparator + dottyInterfaces + File.pathSeparator + otherDeps
370371
val sources =
371372
(unmanagedSources in (Compile, compile)).value ++
372373
(unmanagedSources in (`dotty-compiler`, Compile)).value
@@ -375,7 +376,7 @@ object Build {
375376
"-project", "Dotty",
376377
"-project-version", dottyVersion,
377378
"-project-url", dottyGithubUrl,
378-
"-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps"
379+
"-classpath", docClasspath
379380
)
380381
(runMain in Compile).toTask(
381382
s""" dotty.tools.dottydoc.Main ${args.mkString(" ")} ${sources.mkString(" ")}"""
@@ -386,8 +387,9 @@ object Build {
386387
val args: Seq[String] = spaceDelimited("<arg>").parsed
387388
val dottyLib = (packageAll in `dotty-compiler`).value("dotty-library")
388389
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")
390+
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator)
391+
val docClasspath = dottyLib + File.pathSeparator + dottyInterfaces + File.pathSeparator + otherDeps
392+
val cp: Seq[String] = Seq("-classpath", docClasspath)
391393
(runMain in Compile).toTask(s""" dotty.tools.dottydoc.Main ${cp.mkString(" ")} """ + args.mkString(" "))
392394
}.evaluated,
393395

0 commit comments

Comments
 (0)