Skip to content

use File.pathSeparator for classpath in genDocs #4182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ object Build {
javacOptions in (Compile, doc) --= Seq("-Xlint:unchecked", "-Xlint:deprecation")
)

private lazy val dottydocClasspath = Def.task {
val dottyLib = (packageAll in `dotty-compiler`).value("dotty-library")
val dottyInterfaces = (packageAll in `dotty-compiler`).value("dotty-interfaces")
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator)
dottyLib + File.pathSeparator + dottyInterfaces + File.pathSeparator + otherDeps
}

// Settings shared between dotty-doc and dotty-doc-bootstrapped
lazy val dottyDocSettings = Seq(
baseDirectory in (Compile, run) := baseDirectory.value / "..",
Expand All @@ -363,10 +370,7 @@ object Build {
// Used by sbt-dotty to resolve the latest nightly
val majorVersion = baseVersion.take(baseVersion.lastIndexOf('.'))
IO.write(file("./docs/_site/versions/latest-nightly-base"), majorVersion)

val dottyLib = (packageAll in `dotty-compiler`).value("dotty-library")
val dottyInterfaces = (packageAll in `dotty-compiler`).value("dotty-interfaces")
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":")

val sources =
(unmanagedSources in (Compile, compile)).value ++
(unmanagedSources in (`dotty-compiler`, Compile)).value
Expand All @@ -375,7 +379,7 @@ object Build {
"-project", "Dotty",
"-project-version", dottyVersion,
"-project-url", dottyGithubUrl,
"-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps"
"-classpath", dottydocClasspath.value
)
(runMain in Compile).toTask(
s""" dotty.tools.dottydoc.Main ${args.mkString(" ")} ${sources.mkString(" ")}"""
Expand All @@ -384,10 +388,7 @@ object Build {

dottydoc := Def.inputTaskDyn {
val args: Seq[String] = spaceDelimited("<arg>").parsed
val dottyLib = (packageAll in `dotty-compiler`).value("dotty-library")
val dottyInterfaces = (packageAll in `dotty-compiler`).value("dotty-interfaces")
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":")
val cp: Seq[String] = Seq("-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps")
val cp: Seq[String] = Seq("-classpath", dottydocClasspath.value)
(runMain in Compile).toTask(s""" dotty.tools.dottydoc.Main ${cp.mkString(" ")} """ + args.mkString(" "))
}.evaluated,

Expand Down