forked from scalameta/sbt-scalafmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
70 lines (66 loc) · 2.15 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
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.sonatypeOssRepos("public"),
scalaVersion := "2.12.18",
packageDoc / publishArtifact := sys.env.contains("CI"),
packageSrc / publishArtifact := sys.env.contains("CI")
)
)
publish / skip := true
val scalafmtVersion = "3.7.17"
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 compat reasons we have this in here to ensure we are testing against 1.2.8
// We honestly probably don't need to, so if this ever causes issues, rip it out.
pluginCrossBuild / sbtVersion := "1.2.8"
)
// 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())
)
)