forked from sbt/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
72 lines (69 loc) · 2.65 KB
/
build.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import com.typesafe.sbt.site.util.SiteHelpers
import Docs._
lazy val tutorialSubDirName = settingKey[String]("subdir name for old tutorial")
lazy val fileEncoding = settingKey[String]("check the file encoding")
ThisBuild / organization := "org.scala-sbt"
ThisBuild / scalafmtOnCompile := true
lazy val root = (project in file("."))
.enablePlugins(
(if (!isBetaBranch) Seq(ParadoxSitePlugin) else Seq()) ++
Seq(LowTechSnippetPamfletPlugin, ScriptedPlugin): _*
)
.settings(
name := "website",
siteEmail := "eed3si9n" + "@gmail.com",
// Landing
Compile / paradox / sourceDirectory := baseDirectory.value / "src" / "landing",
Compile / paradoxTheme / sourceDirectory := (Compile / paradox / sourceDirectory).value / "_template",
paradoxProperties ++= Map(
"sbtVersion" -> Docs.targetSbtFullVersion,
"windowsBuild" -> Docs.sbtWindowsBuild,
"sbtVersionForScalaDoc" -> Docs.sbtVersionForScalaDoc,
),
Compile / paradoxRoots := List(
"404.html",
"community.html",
"cookie.html",
"documentation.html",
"download.html",
"index.html",
"learn.html",
"support.html",
),
// Reference
sourceDirectory in Pamflet := baseDirectory.value / "src" / "reference",
siteSubdirName in Pamflet := s"""$targetSbtBinaryVersion/docs""",
tutorialSubDirName := s"""$targetSbtBinaryVersion/tutorial""",
// Redirects
redirectSettings,
SiteHelpers.addMappingsToSiteDir(mappings in Redirect, siteSubdirName in Pamflet),
redirectTutorialSettings,
SiteHelpers.addMappingsToSiteDir(mappings in RedirectTutorial, tutorialSubDirName),
// GitHub Pages. See project/Docs.scala
customGhPagesSettings,
if (scala.sys.BooleanProp.keyExists("sbt.website.generate_pdf"))
Def settings (
// NOTE - PDF settings must be done externally like this because pdf generation generically looks
// through `mappings in Config` for Combined+Pages.md to generate PDF from, and therefore we
// can't create a circular dependency by adding it back into the original mappings.
Pdf.settings,
Pdf.settingsFor(Pamflet, "sbt-reference"),
SiteHelpers.addMappingsToSiteDir(
mappings in Pdf.generatePdf in Pamflet,
siteSubdirName in Pamflet,
)
)
else Nil,
fileEncoding := {
sys.props("file.encoding") match {
case "UTF-8" => "UTF-8"
case x => sys.error(s"Unexpected encoding $x")
}
},
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false,
isGenerateSiteMap := true
)