Skip to content

Fix source links for stdlib #12319

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
May 4, 2021
Merged
Show file tree
Hide file tree
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
16 changes: 12 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1612,12 +1612,20 @@ object Build {
val distLocation = (dist / pack).value
val projectVersion = version.value
IO.createDirectory(file(outDir))
val scala3version = stdlibVersion(Bootstrapped)
val stdLibVersion = stdlibVersion(Bootstrapped)
// TODO add versions etc.
val srcManaged = s"out/bootstrap/stdlib-bootstrapped/scala-$baseVersion/src_managed/main/scala-library-src"
val sourceLinks = s"-source-links:$srcManaged=github://scala/scala/v${stdlibVersion(Bootstrapped)}#src/library"
def srcManaged(v: String, s: String) = s"out/bootstrap/stdlib-bootstrapped/scala-$v/src_managed/main/$s-library-src"
def scalaSrcLink(v: String, s: String) = s"-source-links:$s=github://scala/scala/v$v#src/library"
def dottySrcLink(v: String, s: String) = s"-source-links:$s=github://lampepfl/dotty/$v#library/src"
val revision = Seq("-revision", ref, "-project-version", projectVersion)
val cmd = Seq("-d", outDir, "-project", name, sourceLinks) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
val cmd = Seq(
"-d",
outDir,
"-project",
name,
scalaSrcLink(stdLibVersion, srcManaged(dottyNonBootstrappedVersion, "scala")),
dottySrcLink(referenceVersion, srcManaged(dottyNonBootstrappedVersion, "dotty"))
) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
import _root_.scala.sys.process._
Def.task((s"$distLocation/bin/scaladoc" +: cmd).!)
}
Expand Down
2 changes: 1 addition & 1 deletion scaladoc/src/dotty/tools/scaladoc/PathBased.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ object PathBased:
}.toList

ParsingResult(errors, PathBased(entries, projectRoot))
}
}