forked from scalameta/sbt-scalafmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
67 lines (63 loc) · 1.93 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
def parseTagVersion: String = {
import scala.sys.process._
// drop `v` prefix
"git describe --abbrev=0 --tags".!!.drop(1).trim
}
inThisBuild(
List(
version ~= { dynVer =>
if (System.getenv("CI") != null) dynVer
else s"$parseTagVersion-SNAPSHOT" // only for local publishing
},
organization := "org.scalameta",
homepage := Some(url("https://github.com/scalameta/sbt-scalafmt")),
licenses := Seq(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
developers := List(
Developer(
"poslegm",
"Mikhail Chugunkov",
url("https://chugunkov.website/")
),
Developer(
"olafurpg",
"Ólafur Páll Geirsson",
url("https://geirsson.com")
),
Developer(
"tanishiking",
"Rikito Taniguchi",
url("https://github.com/tanishiking/")
)
),
resolvers += Resolver.sonatypeRepo("public"),
scalaVersion := "2.12.17",
publishArtifact in packageDoc := sys.env.contains("CI"),
publishArtifact in packageSrc := sys.env.contains("CI")
)
)
skip in publish := true
val scalafmtVersion = "3.5.8"
onLoadMessage := s"Welcome to sbt-scalafmt ${version.value} (scalafmt ${scalafmtVersion})"
lazy val plugin = project
.enablePlugins(SbtPlugin)
.settings(
moduleName := "sbt-scalafmt",
libraryDependencies ++= List(
"com.googlecode.java-diff-utils" % "diffutils" % "1.3.0",
"org.scalameta" %% "scalafmt-sysops" % scalafmtVersion,
"org.scalameta" %% "scalafmt-dynamic" % scalafmtVersion
),
scriptedBufferLog := false,
scriptedLaunchOpts += s"-Dplugin.version=${version.value}"
)
// For some reason, it doesn't work if this is defined in globalSettings in PublishPlugin.
inScope(Global)(
Seq(
PgpKeys.pgpPassphrase := sys.env.get("PGP_PASSPHRASE").map(_.toCharArray())
)
)