From a9139df75a52369d88c266c8c927841b8a61352a Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Mon, 18 Feb 2019 12:01:46 -0500 Subject: Add sources to Scaladoc This uses the `-sourcepath` and `-doc-source-url` options when generating Scaladoc in add a link to the Chisel3 GitHub source file. This is setup to link to master if a "-SNAPSHOT" version is used. If the documentation is built for a non-snapshot version, then this will use the "v$version" branch on GitHub. Signed-off-by: Schuyler Eldridge --- build.sbt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'build.sbt') diff --git a/build.sbt b/build.sbt index 0d050f9d..2cffb8b7 100644 --- a/build.sbt +++ b/build.sbt @@ -177,7 +177,18 @@ lazy val chisel = (project in file(".")). "-diagrams-max-classes", "25", "-doc-version", version.value, "-doc-title", name.value, - "-doc-root-content", baseDirectory.value+"/root-doc.txt" + "-doc-root-content", baseDirectory.value+"/root-doc.txt", + "-sourcepath", (baseDirectory in ThisBuild).value.toString, + "-doc-source-url", + { + val branch = + if (version.value.endsWith("-SNAPSHOT")) { + "master" + } else { + s"v${version.value}" + } + s"https://github.com/freechipsproject/chisel3/tree/$branch/€{FILE_PATH}.scala" + } ), // Include macro classes, resources, and sources main JAR since we don't create subproject JARs. mappings in (Compile, packageBin) ++= (mappings in (coreMacros, Compile, packageBin)).value, -- cgit v1.2.3