-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathbuild.sbt
More file actions
109 lines (103 loc) · 3.06 KB
/
Copy pathbuild.sbt
File metadata and controls
109 lines (103 loc) · 3.06 KB
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
101
102
103
104
105
106
107
108
109
// *****************************************************************************
// Build settings
// *****************************************************************************
val scala212 = "2.12.21"
val scala3 = "3.8.4"
inThisBuild(
Seq(
crossScalaVersions := List(scala212, scala3),
organization := "com.github.sbt",
organizationName := "sbt plugins contributors",
startYear := Some(2015),
licenses += License.Apache2,
homepage := Some(url("https://github.com/sbt/sbt-header")),
scmInfo := Some(
ScmInfo(
url("https://github.com/sbt/sbt-header"),
"git@github.com:sbt/sbt-header.git"
)
),
developers := List(
Developer(
"hseeberger",
"Heiko Seeberger",
"mail@heikoseeberger.de",
url("https://github.com/hseeberger")
)
),
scalacOptions ++= List(
"-unchecked",
"-deprecation",
"-encoding",
"UTF-8",
),
scalafmtOnCompile := {
scalaBinaryVersion.value match {
case "2.12" => true
case _ => false
}
},
dynverSeparator := "_", // the default `+` is not compatible with docker tags
)
)
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val `sbt-header` =
project
.in(file("."))
.enablePlugins(AutomateHeaderPlugin, SbtPlugin)
.settings(commonSettings)
.settings(
scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.12" =>
List(
"-Ywarn-unused:imports",
"-Xsource:3",
"-release:8",
)
case _ => Nil
}
},
headerLicense := Some(
HeaderLicense.Custom(
"""|Copyright (c) 2015 - 2025, Heiko Seeberger
|Copyright (c) 2025, sbt plugin contributors
|
|SPDX-License-Identifier: Apache-2.0
|""".stripMargin
)
),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest-wordspec" % "3.2.20" % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % "3.2.20" % Test
),
scriptedLaunchOpts ++= Seq(
"-Xmx1024M",
s"-Dplugin.version=${version.value}",
),
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.9.9"
case _ => "2.0.8"
}
},
scriptedSbt := {
scalaBinaryVersion.value match {
case "2.12" => "1.11.6"
case _ => (pluginCrossBuild / sbtVersion).value
}
},
)
// *****************************************************************************
// Project settings
// *****************************************************************************
lazy val commonSettings =
Seq(
// Also (automatically) format build definition together with sources
Compile / scalafmt := {
val _ = (Compile / scalafmtSbt).value
(Compile / scalafmt).value
},
)