-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.sbt
54 lines (43 loc) · 1.59 KB
/
site.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// See: https://github.com/sbt/sbt-site
enablePlugins(PreprocessPlugin)
enablePlugins(SiteScaladocPlugin)
import com.typesafe.sbt.SbtGhPages._
preprocessVars in Preprocess := Map(
"REPO" -> "gov.nasa.jpl.imce",
"ORG" -> "JPL-IMCE",
"SUBJECT" -> "jpl-imce",
"ORG_NAME" -> organizationName.value,
"DESC" -> description.value,
"PKG" -> moduleName.value,
"CONTRIBUTORS" -> {
val commit = Process("git rev-parse HEAD").lines.head
val p1 = Process(s"git shortlog -sne --no-merges $commit")
val p2 = Process(
Seq("sed",
"-e",
"""s|^\s*\([0-9][0-9]*\)\s*\(\w.*\w\)\s*<\([a-zA-Z].*\)>.*$|<tr><td align='right'>\1</td><td>\2</td><td>\3</td></tr>|"""))
val whoswho = p1 #| p2
whoswho.lines.mkString("\n")
},
"VERSION" -> {
git.gitCurrentTags.value match {
case Seq(tag) =>
s"""<a href="https://github.com/JPL-IMCE/${moduleName.value}/tree/$tag">$tag</a>"""
case _ =>
val v = version.value
git.gitHeadCommit.value.fold[String](v) { sha =>
if (git.gitUncommittedChanges.value)
v
else
s"""<a href="https://github.com/JPL-IMCE/${moduleName.value}/tree/$sha">$v</a>"""
}
}
}
)
target in preprocess := (target in makeSite).value
ghpages.settings
makeSite <<= makeSite.dependsOn(dumpLicenseReport)
siteMappings <<= siteMappings.dependsOn(dumpLicenseReport)
siteMappings += (licenseReportDir.value / "LicenseReportOfAggregatedSBTPluginsAndLibraries.html") -> "LicenseReportOfAggregatedSBTPluginsAndLibraries.html"
previewFixedPort := Some(4004)
previewLaunchBrowser := false