-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
134 lines (126 loc) · 4.05 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
import ReleaseTransformations._
ThisBuild / crossScalaVersions := Seq("2.12.14", "2.13.6")
ThisBuild / scalaVersion := crossScalaVersions.value.last
ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]")
ThisBuild / githubWorkflowPublishTargetBranches := Nil
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(
List("clean", "coverage", "test", "coverageReport"),
id = None,
name = Some("test")
),
WorkflowStep.Use(
UseRef.Public(
"codecov",
"codecov-action",
"v1"
)
)
)
lazy val Vers = new {
val circe = "0.14.1"
val scalatest = "3.2.11"
}
lazy val commonSettings = Seq(
name := "Argus",
organization := "io.circe",
scalacOptions ++= Seq("-target:jvm-1.8") ++ {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => Seq("-Ymacro-annotations")
case _ => Seq("-Ypartial-unification")
}
},
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n < 13 =>
Seq(compilerPlugin(("org.scalamacros" %% "paradise" % "2.1.1").cross(CrossVersion.full)))
case _ => Seq.empty
}
},
homepage := Some(url("https://github.com/aishfenton/Argus")),
licenses := Seq("MIT License" -> url("http://www.opensource.org/licenses/MIT")),
// NB: We put example schemas in main package since otherwise the macros can't run for test (since they
// execute before test-classes is populated). But then we need to exclude them from packing.
Compile / packageBin / mappings ~= {
_.filter(!_._1.getName.endsWith(".json"))
},
publishMavenStyle := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots".at(nexus + "content/repositories/snapshots"))
else
Some("releases".at(nexus + "service/local/staging/deploy/maven2"))
},
Test / publishArtifact := false,
pomIncludeRepository := (_ => false),
sonatypeProfileName := "com.github.aishfenton",
pomExtra :=
<scm>
<url>[email protected]:aishfenton/Argus.git</url>
<connection>scm:git:[email protected]:aishfenton/Argus.git</connection>
</scm>
<developers>
<developer>
<id>aishfenton</id>
<name>Aish Fenton</name>
</developer>
<developer>
<id>datamusing</id>
<name>Sudeep Das</name>
</developer>
<developer>
<id>dbtsai</id>
<name>DB Tsai</name>
</developer>
<developer>
<id>rogermenezes</id>
<name>Roger Menezes</name>
</developer>
</developers>,
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
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val argus = project
.settings(moduleName := "circe-argus")
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided,
"io.circe" %% "circe-core" % Vers.circe,
"io.circe" %% "circe-generic" % Vers.circe,
"io.circe" %% "circe-parser" % Vers.circe,
"org.scalactic" %% "scalactic" % Vers.scalatest % Test,
"org.scalatest" %% "scalatest" % Vers.scalatest % Test
)
)
.dependsOn(runtime % Test)
lazy val runtime = project
.settings(moduleName := "circe-argus-runtime")
.settings(commonSettings: _*)
lazy val root = project
.in(file("."))
.aggregate(argus, runtime)
.settings(commonSettings: _*)
.settings(noPublishSettings: _*)
// Clears screen between refreshes in continuous mode
maxErrors := 5
watchTriggeredMessage := Watch.clearScreenOnTrigger