This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
113 lines (106 loc) · 3.29 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
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
110
111
112
113
import ReleaseTransformations._
lazy val V = _root_.scalafix.sbt.BuildInfo
lazy val commonSettings = Def.settings(
List(
organization := "com.github.xuwei-k",
homepage := Some(url("https://github.com/xuwei-k/replace-symbol-literals")),
licenses := Seq("MIT License" -> url("https://opensource.org/licenses/mit-license")),
description := "scalafix rule for replace deprecated scala.Symbol literals",
scalaVersion := V.scala212,
addCompilerPlugin(scalafixSemanticdb),
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
),
pomExtra := (
<developers>
<developer>
<id>xuwei-k</id>
<name>Kenji Yoshida</name>
<url>https://github.com/xuwei-k</url>
</developer>
</developers>
<scm>
<url>[email protected]:xuwei-k/replace-symbol-literals.git</url>
<connection>scm:git:[email protected]:xuwei-k/replace-symbol-literals.git</connection>
</scm>
),
publishTo := sonatypePublishTo.value,
(Compile / doc / scalacOptions) ++= {
val hash = sys.process.Process("git rev-parse HEAD").lineStream_!.head
Seq(
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url",
s"https://github.com/xuwei-k/replace-symbol-literals/tree/${hash}€{FILE_PATH}.scala"
)
},
scalacOptions ++= PartialFunction
.condOpt(CrossVersion.partialVersion(scalaVersion.value)) {
case Some((2, v)) if v >= 12 =>
Seq(
"-Ywarn-unused:imports",
)
}
.toList
.flatten,
scalacOptions ++= PartialFunction
.condOpt(CrossVersion.partialVersion(scalaVersion.value)) {
case Some((2, v)) if v <= 12 =>
Seq(
"-Yno-adapted-args",
"-Xfuture",
)
}
.toList
.flatten,
scalacOptions ++= List(
"-deprecation",
"-unchecked",
"-Yrangepos",
"-P:semanticdb:synthetics:on"
)
)
)
commonSettings
publish / skip := true
lazy val rules = project.settings(
commonSettings,
name := "replace-symbol-literals",
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % V.scalafixVersion
)
lazy val input = project.settings(
commonSettings,
publish / skip := true
)
lazy val output = project.settings(
commonSettings,
publish / skip := true
)
lazy val tests = project
.settings(
commonSettings,
publish / skip := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full,
(Compile / compile) :=
(Compile / compile).dependsOn(input / Compile / compile).value,
scalafixTestkitOutputSourceDirectories :=
(output / Compile / sourceDirectories).value,
scalafixTestkitInputSourceDirectories :=
(input / Compile / sourceDirectories).value,
scalafixTestkitInputClasspath :=
(input / Compile / fullClasspath).value,
)
.dependsOn(rules)
.enablePlugins(ScalafixTestkitPlugin)