-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
139 lines (111 loc) · 3.79 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
import xerial.sbt.Sonatype._
import ReleaseTransformations._
// https://github.com/xerial/sbt-sonatype/issues/71
publishTo in ThisBuild := sonatypePublishTo.value
lazy val commons = Seq(
organization := "com.github.andyglow",
homepage := Some(new URL("http://github.com/andyglow/caseclass-evolution")),
startYear := Some(2019),
organizationName := "andyglow",
scalaVersion := "2.13.6",
crossScalaVersions := Seq("2.11.12", "2.12.14", "2.13.6"),
scalacOptions ++= {
val options = Seq(
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-deprecation",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-language:experimental.macros")
// WORKAROUND https://github.com/scala/scala/pull/5402
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => options.map {
case "-Xlint" => "-Xlint:-unused,_"
case "-Ywarn-unused-import" => "-Ywarn-unused:imports,-patvars,-privates,-locals,-params,-implicits"
case other => other
}
case Some((2, n)) if n >= 13 => options.filterNot { opt =>
opt == "-Yno-adapted-args" || opt == "-Xfuture"
} :+ "-Xsource:2.13"
case _ => options
}
},
scalacOptions in (Compile,doc) ++= Seq(
"-groups",
"-implicits",
"-no-link-warnings"),
licenses := Seq(("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))),
sonatypeProfileName := "com.github.andyglow",
publishMavenStyle := true,
sonatypeProjectHosting := Some(
GitHubHosting(
"andyglow",
"scala-jsonschema",
"andyglow@gmail.com")),
scmInfo := Some(
ScmInfo(
url("https://github.com/andyglow/scala-jsonschema"),
"scm:git@github.com:andyglow/scala-jsonschema.git")),
developers := List(
Developer(
id = "andyglow",
name = "Andriy Onyshchuk",
email = "andyglow@gmail.com",
url = url("https://ua.linkedin.com/in/andyglow"))),
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _), enableCrossBuild = true),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _), enableCrossBuild = true),
pushChanges),
Compile / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => "-Ymacro-annotations" :: Nil
case _ => Nil
}
},
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => Nil
case _ => compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full) :: Nil
}
},
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % Test
)
resolvers ++= Seq("snapshots", "releases").map(Resolver.sonatypeRepo)
lazy val core = (project in file("core"))
.settings(
commons,
name := "caseclass-evolution",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value))
lazy val example = (project in file("example"))
.dependsOn(core)
.settings(
commons,
name := "caseclass-example",
publish / skip := true,
publishArtifact := false)
lazy val root = (project in file("."))
.aggregate(core, example)
.settings(
commons,
name := "caseclass-root",
crossScalaVersions := Nil,
publish / skip := true,
publishArtifact := false,
aggregate in update := false)