-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
154 lines (145 loc) · 4.3 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import sbtrelease._
import ReleaseStateTransformations._
Global / onChangedBuildSource := ReloadOnSourceChanges
def gitHash(): String = sys.process.Process("git rev-parse HEAD").lineStream_!.head
val tagName = Def.setting {
s"v${if (releaseUseGlobalVersion.value) (ThisBuild / version).value
else version.value}"
}
val tagOrHash = Def.setting {
if (isSnapshot.value) gitHash() else tagName.value
}
val Scala212 = "2.12.20"
val unusedWarnings = Seq("-Ywarn-unused:imports")
lazy val commonSettings = Def.settings(
startYear := Some(2019),
scalapropsCoreSettings,
(Compile / unmanagedResources) += (LocalRootProject / baseDirectory).value / "LICENSE.txt",
scalaVersion := Scala212,
crossScalaVersions := Seq(Scala212, "2.13.16"),
organization := "com.github.scalaprops",
scalacOptions ++= unusedWarnings,
Seq(Compile, Test).flatMap(c => c / console / scalacOptions --= unusedWarnings),
scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-unit",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq(
"-Yno-adapted-args",
"-Xlint:unsound-match",
"-Xfuture",
)
case _ =>
Nil
}
},
(Compile / doc / scalacOptions) ++= {
val tag = tagOrHash.value
Seq(
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url",
s"https://github.com/scalaprops/scalaprops-deriving/tree/${tag}€{FILE_PATH}.scala"
)
},
scalapropsVersion := "0.9.1",
libraryDependencies ++= Seq(
"com.github.scalaprops" %% "scalaprops" % scalapropsVersion.value % "test",
),
homepage := Some(url("https://github.com/scalaprops/scalaprops-deriving")),
licenses := Seq("MIT License" -> url("https://opensource.org/licenses/mit-license")),
pomExtra := (
<developers>
<developer>
<id>xuwei-k</id>
<name>Kenji Yoshida</name>
<url>https://github.com/xuwei-k</url>
</developer>
</developers>
<scm>
<url>git@github.com:scalaprops/scalaprops-deriving.git</url>
<connection>scm:git:git@github.com:scalaprops/scalaprops-deriving.git</connection>
<tag>{tagOrHash.value}</tag>
</scm>
),
publishTo := sonatypePublishToBundle.value,
releaseTagName := tagName.value,
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
UpdateReadme.updateReadmeProcess,
tagRelease,
releaseStepCommand("set ThisBuild / useSuperShell := false"),
ReleaseStep(
action = { state =>
val extracted = Project extract state
extracted.runAggregated(extracted.get(thisProjectRef) / (Global / PgpKeys.publishSigned), state)
},
enableCrossBuild = true
),
releaseStepCommand("set ThisBuild / useSuperShell := true"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
UpdateReadme.updateReadmeProcess,
pushChanges
)
)
val core = project.settings(
name := "scalaprops-deriving",
description := "scalaz-deriving instances for scalaprops",
commonSettings,
libraryDependencies ++= Seq(
"com.github.scalaprops" %% "scalaprops-scalaz" % scalapropsVersion.value,
"org.scalaz" %% "scalaz-deriving" % "3.0.0-M7",
)
)
val exampleMacro = project
.in(file("example/macro"))
.settings(
commonSettings,
publish / skip := true,
libraryDependencies ++= Seq(
"org.scalaz" %% "deriving-macro" % "3.0.0-M7",
)
)
.dependsOn(
core
)
val exampleCompilerPlugin = project
.in(file("example/compiler-plugin"))
.settings(
commonSettings,
publish / skip := true,
libraryDependencies ++= Seq(
compilerPlugin("org.scalaz" %% "deriving-plugin" % "3.0.0-M7" cross CrossVersion.full),
)
)
.dependsOn(
core
)
commonSettings
publish / skip := true