-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sbt
More file actions
64 lines (56 loc) · 2.07 KB
/
build.sbt
File metadata and controls
64 lines (56 loc) · 2.07 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
import sbtwelcome.*
val scala2Version = "2.12.18"
val scala3Version = "3.6.2"
inThisBuild(
List(
organization := "com.github.reibitto",
homepage := Some(url("https://github.com/reibitto/sbt-welcome")),
licenses := List("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer("reibitto", "reibitto", "reibitto@users.noreply.github.com", url("https://reibitto.github.io"))
),
scalaVersion := scala2Version,
crossScalaVersions += scala3Version
)
)
lazy val root = (project in file(".")).settings(
name := "sbt-welcome",
organization := "com.github.reibitto",
sbtPlugin := true,
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test,
pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" => "1.10.7"
case _ => "2.0.0-M1"
}
},
conflictWarning := {
scalaBinaryVersion.value match {
case "3" => ConflictWarning("warn", Level.Warn, false)
case _ => conflictWarning.value
}
}
)
addCommandAlias("fmt", "all root/scalafmtSbt root/scalafmtAll")
addCommandAlias("fmtCheck", "all root/scalafmtSbtCheck root/scalafmtCheckAll")
logo :=
s"""
| ______ _____ ______
|__________ /___ /_ ___ _________ /__________________ ________
|__ ___/_ __ \\ __/ __ | /| / / _ \\_ /_ ___/ __ \\_ __ `__ \\ _ \\
|_(__ )_ /_/ / /_ __ |/ |/ // __/ / / /__ / /_/ / / / / / / __/
|/____/ /_.___/\\__/ ____/|__/ \\___//_/ \\___/ \\____//_/ /_/ /_/\\___/
|
|${version.value}
|
|${scala.Console.YELLOW}Scala ${scalaVersion.value}${scala.Console.RESET}
|
|""".stripMargin
usefulTasks := Seq(
UsefulTask("~compile", "Compile with file-watch enabled"),
UsefulTask("test", "Run all tests"),
UsefulTask("fmt", "Run scalafmt on the entire project"),
UsefulTask("publishLocal", "Publish the sbt plugin locally so that you can consume it from a different project")
)
logoColor := scala.Console.MAGENTA
ThisBuild / organization := "com.github.reibitto"