-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.sbt
100 lines (93 loc) · 3.42 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.HeaderPattern.commentBetween
import de.heikoseeberger.sbtheader.CommentStyle
import de.heikoseeberger.sbtheader.FileType
import de.heikoseeberger.sbtheader.LineCommentCreator
// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed
(ThisBuild / dynverVTagPrefix) := false
// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Global / onLoad := (Global / onLoad).value.andThen { s =>
dynverAssertTagVersion.value
s
}
lazy val `play-doc` = (project in file("."))
.enablePlugins(Omnidoc, SbtTwirl, HeaderPlugin)
.settings(
organization := "org.playframework",
organizationName := "The Play Framework Project",
organizationHomepage := Some(url("https://playframework.com")),
homepage := Some(url(s"https://github.com/playframework/${Omnidoc.repoName}")),
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
crossScalaVersions := Seq("2.12.20", "2.13.16", "3.3.5"),
developers += Developer(
"playframework",
"The Play Framework Contributors",
url("https://github.com/playframework")
),
headerLicense := Some(
HeaderLicense.Custom(
"Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>"
)
),
headerMappings ++= Map(
FileType("sbt") -> HeaderCommentStyle.cppStyleLineComment,
FileType("properties") -> HeaderCommentStyle.hashLineComment,
FileType("md") -> CommentStyle(new LineCommentCreator("<!---", "-->"), commentBetween("<!---", "*", "-->"))
),
(Compile / headerSources) ++=
((baseDirectory.value ** ("*.properties" || "*.md" || "*.sbt"))
--- (baseDirectory.value ** "target" ** "*")
--- (baseDirectory.value / "src/test/resources" ** "*")).get ++
(baseDirectory.value / "project" ** "*.scala" --- (baseDirectory.value ** "target" ** "*")).get,
(Test / headerResources) := Seq(),
pomIncludeRepository := { _ => false },
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Seq(
"-Xlint",
"-Ywarn-unused:imports",
"-Xlint:nullary-unit",
"-Ywarn-dead-code",
"-Xsource:3",
"-Xmigration",
)
case _ => Nil
}
}
)
libraryDependencies ++= Seq(
("org.pegdown" % "pegdown" % "1.6.0").exclude("org.parboiled", "parboiled-java"),
"org.parboiled" % "parboiled-java" % "1.4.1",
"commons-io" % "commons-io" % "2.18.0",
"org.specs2" %% "specs2-core" % "4.20.9" % Test
)
javacOptions ++= Seq(
"--release",
"11",
"-Xlint:deprecation",
"-Xlint:unchecked",
"-Xlint:-options",
"-encoding",
"UTF-8",
)
doc / javacOptions := Seq("-source", "11")
scalacOptions ++= Seq(
"-release",
"11",
"-deprecation",
"-feature",
"-unchecked",
"-encoding",
"utf8"
)
addCommandAlias(
"validateCode",
List(
"headerCheckAll",
"scalafmtSbtCheck",
"scalafmtCheckAll",
).mkString(";")
)