Skip to content

Commit 3af2320

Browse files
committed
Documentation of scala3doc uses commit hash
This makes our source link precisily pin-point used source not what is currently on master.
1 parent 6aed05c commit 3af2320

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

project/Build.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ object Build {
14561456
def asScala3doc: Project = {
14571457
def generateDocumentation(targets: String, name: String, outDir: String, params: String = "") = Def.taskDyn {
14581458
val projectVersion = version.value
1459-
val sourcesAndRevision = s"-s github://lampepfl/dotty --revision master --projectVersion $projectVersion"
1459+
val sourcesAndRevision = s"-s github://lampepfl/dotty --projectVersion $projectVersion"
14601460
run.in(Compile).toTask(
14611461
s""" -d scala3doc/output/$outDir -t $targets -n "$name" $sourcesAndRevision $params"""
14621462
)
@@ -1494,10 +1494,11 @@ object Build {
14941494
fork.in(test) := true,
14951495
baseDirectory.in(run) := baseDirectory.in(ThisBuild).value,
14961496
generateSelfDocumentation := Def.taskDyn {
1497+
val revision = VersionUtil.gitHash
14971498
generateDocumentation(
14981499
classDirectory.in(Compile).value.getAbsolutePath,
1499-
"scala3doc", "self",
1500-
"-p scala3doc/documentation --projectLogo scala3doc/documentation/logo.svg",
1500+
"scala3doc", "self",
1501+
s"-p scala3doc/documentation --projectLogo scala3doc/documentation/logo.svg --revision $revision",
15011502
)
15021503
}.value,
15031504
generateScala3Documentation := Def.taskDyn {
@@ -1512,7 +1513,7 @@ object Build {
15121513
val roots = joinProducts(dottyJars)
15131514

15141515
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
1515-
else generateDocumentation(roots, "Scala 3", "scala3", "-p scala3doc/scala3-docs --projectLogo scala3doc/scala3-docs/logo.svg")
1516+
else generateDocumentation(roots, "Scala 3", "scala3", "-p scala3doc/scala3-docs --projectLogo scala3doc/scala3-docs/logo.svg --revision master")
15161517
}.value,
15171518
generateTestcasesDocumentation := Def.taskDyn {
15181519
generateDocumentation(Build.testcasesOutputDir.in(Test).value, "Scala3doc testcases", "testcases")

0 commit comments

Comments
 (0)