-
Notifications
You must be signed in to change notification settings - Fork 108
/
build.sbt
217 lines (196 loc) · 5.43 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
import build._
def disableScala2_12 = disableScala("2.12")
def disableScala(v: String) = Def.settings(
mimaPreviousArtifacts := {
if (scalaBinaryVersion.value == v) {
Set.empty
} else {
mimaPreviousArtifacts.value
}
},
libraryDependencies := {
if (scalaBinaryVersion.value == v) {
Nil
} else {
libraryDependencies.value
}
},
Seq(Compile, Test).map { x =>
(x / sources) := {
if (scalaBinaryVersion.value == v) {
Nil
} else {
(x / sources).value
}
}
},
Test / test := {
if (scalaBinaryVersion.value == v) {
()
} else {
(Test / test).value
}
},
publish / skip := (scalaBinaryVersion.value == v)
)
val argonaut = argonautCrossProject(
"argonaut",
Seq(JVMPlatform, JSPlatform, NativePlatform)
).settings(
InfoSettings.all ++ Seq[Sett](
name := "argonaut",
(Compile / sourceGenerators) += ((Compile / sourceManaged) map Boilerplate.gen).taskValue
)
)
val argonautJVM = argonaut.jvm
val argonautJS = argonaut.js
val argonautNative = argonaut.native
val argonautScalaz = argonautCrossProject(
"argonaut-scalaz",
Seq(JVMPlatform, JSPlatform, NativePlatform)
).settings(
name := "argonaut-scalaz",
libraryDependencies ++= Seq(
"org.scalaz" %%% "scalaz-core" % scalazVersion
)
).platformsSettings(JVMPlatform, JSPlatform, NativePlatform)(
libraryDependencies += "org.scalaz" %%% "scalaz-scalacheck-binding" % scalazVersion % "test",
).dependsOn(argonaut % "compile->compile;test->test")
val argonautScalazJVM = argonautScalaz.jvm
val argonautScalazJS = argonautScalaz.js
val argonautScalazNative = argonautScalaz.native
val argonautMonocle = argonautCrossProject(
"argonaut-monocle",
Seq(JVMPlatform, JSPlatform)
).settings(
name := "argonaut-monocle3",
previousVersions --= (0 to 6).map(n => s"6.3.$n"),
libraryDependencies ++= Seq(
"dev.optics" %%% "monocle-core" % monocleVersion,
"dev.optics" %%% "monocle-macro" % monocleVersion,
"dev.optics" %%% "monocle-law" % monocleVersion % "test"
),
disableScala2_12
).dependsOn(argonaut % "compile->compile;test->test", argonautCats % "compile->compile;test->test")
val argonautMonocleJVM = argonautMonocle.jvm
val argonautMonocleJS = argonautMonocle.js
lazy val argonautCats = argonautCrossProject(
"argonaut-cats",
Seq(JVMPlatform, JSPlatform, NativePlatform)
).settings(
name := "argonaut-cats",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "cats-laws" % catsVersion % "test"
)
).dependsOn(argonaut % "compile->compile;test->test")
val argonautCatsJVM = argonautCats.jvm
val argonautCatsJS = argonautCats.js
val argonautCatsNative = argonautCats.native
val argonautJawn = argonautCrossProject(
"argonaut-jawn",
Seq(JVMPlatform, JSPlatform, NativePlatform)
).settings(
name := "argonaut-jawn",
libraryDependencies ++= Seq(
"org.typelevel" %%% "jawn-parser" % "1.6.0"
)
).dependsOn(argonaut % "compile->compile;test->test")
val argonautJawnJVM = argonautJawn.jvm
val argonautJawnJS = argonautJawn.js.settings(
mimaPreviousArtifacts := {
mimaPreviousArtifacts.value -- (0 to 5).map { n =>
oldGroupId %% s"${Keys.name.value}_sjs1" % s"6.3.${n}"
}
}
)
val argonautJawnNative = argonautJawn.native
val argonautBenchmark = Project(
id = "argonaut-benchmark",
base = file("argonaut-benchmark")
).settings(
base ++ ReleasePlugin.projectSettings ++ PublishSettings.all ++ Seq[Sett](
name := "argonaut-benchmark",
run / fork := true,
publishArtifact := false,
mimaFailOnNoPrevious := false,
libraryDependencies ++= Seq(
"com.google.caliper" % "caliper" % "0.5-rc1",
"com.fasterxml.jackson.core" % "jackson-core" % "2.18.2"
),
(run / javaOptions) ++= ((Runtime / fullClasspath) map { cp =>
Seq("-cp", sbt.Attributed.data(cp).mkString(":"))
}).value
)
).dependsOn(argonautJVM)
lazy val nativeProjects = Seq[ProjectReference](
argonautNative,
argonautScalazNative,
argonautJawnNative,
argonautCatsNative
)
val jsProjects = Seq(
argonautJS,
argonautScalazJS,
argonautMonocleJS,
argonautCatsJS,
argonautJawnJS
)
val jvmProjects = Seq(
argonautJVM,
argonautScalazJVM,
argonautMonocleJVM,
argonautCatsJVM,
argonautJawnJVM,
argonautBenchmark
)
lazy val noPublish = Seq(
mimaFailOnNoPrevious := false,
PgpKeys.publishSigned := {},
PgpKeys.publishLocalSigned := {},
publishLocal := {},
previousVersions := Nil,
Compile / publishArtifact := false,
publish := {}
)
val nativeParent = Project(
"nativeParent",
file("native-parent")
).settings(
base,
noPublish,
nativeSettings
).aggregate(
nativeProjects *
)
val jvmParent = project
.settings(
base,
noPublish
)
.aggregate(
jvmProjects.map(p => p: ProjectReference) *
)
val jsParent = project
.settings(
base,
noPublish,
commands += Command.command("testSequential") {
// avoid "org.scalajs.jsenv.ComJSEnv$ComClosedException: Node.js isn't connected" error in CI
jsProjects.map(_.id + "/test").sorted.toList ::: _
},
commands += Command.command("testSequentialCross") {
jsProjects.map(x => s"+${x.id}/test").sorted.toList ::: _
}
)
.aggregate(
jsProjects.map(p => p: ProjectReference) *
)
base
ReleasePlugin.projectSettings
mimaFailOnNoPrevious := false
PublishSettings.all
noPublish
name := "argonaut-parent"
run / fork := true
ThisBuild / sonatypeCredentialHost := Sonatype.sonatypeCentralHost