-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
63 lines (55 loc) · 2.27 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
// Copyright (C) from 2023 The sbt contributors <https://github.com/sbt>
import de.heikoseeberger.sbtheader.CommentStyle
import de.heikoseeberger.sbtheader.FileType
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.HeaderPattern.commentBetween
import de.heikoseeberger.sbtheader.LineCommentCreator
lazy val `sbt-maven-plugin` = (project in file("."))
.enablePlugins(SbtWebBase)
.settings(
scriptedLaunchOpts ++= Seq(
s"-Dplugin.version=${version.value}",
"-Xmx128m"
),
scriptedBufferLog := false,
headerLicense := Some(
HeaderLicense.Custom("Copyright (C) from 2023 The sbt contributors <https://github.com/sbt>")
),
Compile / 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" ** "*")).get ++
(baseDirectory.value / "project" ** "*.scala" --- (baseDirectory.value ** "target" ** "*")).get ++
(baseDirectory.value / "src" / "sbt-test" ** ("*.java" || "*.scala" || "*.sbt")).get()
)
sonatypeProfileName := "com.github.sbt.sbt-maven-plugin" // See https://issues.sonatype.org/browse/OSSRH-77819#comment-1203625
developers += Developer(
"playframework",
"The Play Framework Team",
url("https://github.com/playframework")
)
libraryDependencies ++= Seq(
"org.apache.maven.plugins" % "maven-plugin-plugin" % "3.15.1",
"junit" % "junit" % "4.13.2" % Test
)
// 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
}
addCommandAlias(
"validateCode",
List(
"scalafmtSbtCheck",
"scalafmtCheckAll",
"javafmtCheckAll",
"headerCheck"
).mkString(";")
)