-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
216 lines (198 loc) · 8.96 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
import xerial.sbt.Sonatype._
ThisBuild / versionScheme := Some("semver-spec")
lazy val commonSettings = Seq(
scalaVersion := "2.13.15",
crossScalaVersions := List("2.13.15", "2.12.20"),
Global / cancelable := true,
scalafmtOnCompile := false,
ThisBuild / scapegoatVersion := Versions.Scapegoat,
scapegoatDisabledInspections := Seq("ObjectNames", "EmptyCaseClass"),
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.13.3" cross CrossVersion.full),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"),
addCompilerPlugin(scalafixSemanticdb),
autoCompilerPlugins := true,
externalResolvers := Seq(DefaultMavenRepository) ++ Resolver.sonatypeOssRepos("snapshots") ++ Seq(
Resolver.typesafeIvyRepo("releases"),
Resolver.bintrayRepo("azavea", "maven"),
Resolver.bintrayRepo("azavea", "geotrellis"),
"locationtech-releases" at "https://repo.locationtech.org/content/groups/releases",
"locationtech-snapshots" at "https://repo.locationtech.org/content/groups/snapshots",
Resolver.bintrayRepo("guizmaii", "maven"),
Resolver.bintrayRepo("colisweb", "maven"),
"jitpack".at("https://jitpack.io"),
Resolver.file("local", file(Path.userHome.absolutePath + "/.ivy2/local"))(
Resolver.ivyStylePatterns
)
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val publishSettings = Seq(
organization := "com.azavea.stac4s",
organizationName := "Azavea",
organizationHomepage := Some(new URL("https://azavea.com/")),
description := "stac4s is a scala library with primitives to build applications using the SpatioTemporal Asset Catalogs specification",
Test / publishArtifact := false
) ++ sonatypeSettings
lazy val sonatypeSettings = Seq(
publishMavenStyle := true,
sonatypeProfileName := "com.azavea",
sonatypeProjectHosting := Some(GitHubHosting(user = "azavea", repository = "stac4s", email = "[email protected]")),
developers := List(
Developer(
id = "cbrown",
name = "Christopher Brown",
email = "[email protected]",
url = url("https://github.com/notthatbreezy")
),
Developer(
id = "jsantucci",
name = "James Santucci",
email = "[email protected]",
url = url("https://github.com/jisantuc")
),
Developer(
id = "aaronxsu",
name = "Aaron Su",
email = "[email protected]",
url = url("https://github.com/aaronxsu")
),
Developer(
id = "pomadchin",
name = "Grigory Pomadchin",
email = "[email protected]",
url = url("https://github.com/pomadchin")
),
Developer(
id = "azavea",
name = "Azavea Inc.",
email = "[email protected]",
url = url("https://www.azavea.com")
)
),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
)
val jvmGeometryDependencies = Def.setting {
Seq(
"org.locationtech.jts" % "jts-core" % Versions.Jts,
"org.locationtech.geotrellis" %% "geotrellis-vector" % Versions.GeoTrellis
)
}
val coreDependenciesJVM = Def.setting {
Seq(
"org.threeten" % "threeten-extra" % Versions.ThreeTenExtra,
"io.circe" %% "circe-json-schema" % Versions.CirceJsonSchema
) ++ jvmGeometryDependencies.value
}
val testingDependenciesJVM = Def.setting {
Seq(
"org.locationtech.geotrellis" %% "geotrellis-vector" % Versions.GeoTrellis,
"org.locationtech.jts" % "jts-core" % Versions.Jts,
"org.threeten" % "threeten-extra" % Versions.ThreeTenExtra
)
}
val testRunnerDependenciesJVM = Seq(
"io.circe" %% "circe-testing" % Versions.Circe % Test,
"org.scalatest" %% "scalatest" % Versions.Scalatest % Test,
"org.scalatestplus" %% "scalacheck-1-16" % Versions.ScalatestPlusScalacheck % Test
)
lazy val root = project
.in(file("."))
.settings(name := "stac4s")
.settings(commonSettings)
.settings(publishSettings)
.settings(noPublishSettings)
.aggregate(coreJS, coreJVM, testingJS, testingJVM, coreTestJS, coreTestJVM, clientJS, clientJVM)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.in(file("modules/core"))
.settings(commonSettings)
.settings(publishSettings)
.settings({
libraryDependencies ++= Seq(
"com.beachape" %%% "enumeratum" % Versions.Enumeratum,
"com.beachape" %%% "enumeratum-circe" % Versions.Enumeratum,
"com.chuusai" %%% "shapeless" % Versions.Shapeless,
"com.github.julien-truffaut" %%% "monocle-core" % Versions.Monocle,
"com.github.julien-truffaut" %%% "monocle-macro" % Versions.Monocle,
"eu.timepit" %%% "refined" % Versions.Refined,
"io.circe" %%% "circe-core" % Versions.Circe,
"io.circe" %%% "circe-generic" % Versions.Circe,
"io.circe" %%% "circe-parser" % Versions.Circe,
"io.circe" %%% "circe-refined" % Versions.CirceRefined,
"org.typelevel" %%% "cats-core" % Versions.Cats,
"org.typelevel" %%% "cats-kernel" % Versions.Cats
)
})
.jvmSettings(libraryDependencies ++= coreDependenciesJVM.value)
.jsSettings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % Versions.ScalaJavaTime)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val testing = crossProject(JSPlatform, JVMPlatform)
.in(file("modules/testing"))
.dependsOn(core)
.settings(commonSettings)
.settings(publishSettings)
.settings(
libraryDependencies ++= Seq(
"com.beachape" %%% "enumeratum" % Versions.Enumeratum,
"com.beachape" %%% "enumeratum-scalacheck" % Versions.Enumeratum,
"com.chuusai" %%% "shapeless" % Versions.Shapeless,
"eu.timepit" %%% "refined-scalacheck" % Versions.Refined,
"eu.timepit" %%% "refined" % Versions.Refined,
"io.chrisdavenport" %%% "cats-scalacheck" % Versions.ScalacheckCats,
"io.circe" %%% "circe-core" % Versions.Circe,
"io.circe" %%% "circe-literal" % Versions.Circe,
"org.scalacheck" %%% "scalacheck" % Versions.Scalacheck,
"org.typelevel" %%% "cats-core" % Versions.Cats
)
)
.jvmSettings(libraryDependencies ++= testingDependenciesJVM.value)
.jsSettings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % Versions.ScalaJavaTime % Test)
lazy val testingJVM = testing.jvm
lazy val testingJS = testing.js
lazy val coreTest = crossProject(JSPlatform, JVMPlatform)
.in(file("modules/core-test"))
.dependsOn(testing % Test)
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
libraryDependencies ++= Seq(
"io.circe" %%% "circe-testing" % Versions.Circe % Test,
"org.scalatest" %%% "scalatest" % Versions.Scalatest % Test,
"org.scalatestplus" %%% "scalacheck-1-16" % Versions.ScalatestPlusScalacheck % Test,
"org.typelevel" %%% "discipline-scalatest" % Versions.DisciplineScalatest % Test
)
)
.jsSettings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % Versions.ScalaJavaTime % Test)
lazy val coreTestJVM = coreTest.jvm
lazy val coreTestJS = coreTest.js
lazy val coreTestRef = LocalProject("modules/core-test")
lazy val client = crossProject(JSPlatform, JVMPlatform)
.in(file("modules/client"))
.dependsOn(core, testing % Test)
.settings(commonSettings)
.settings(publishSettings)
.settings(
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % Versions.Circe,
"io.circe" %%% "circe-generic" % Versions.Circe,
"io.circe" %%% "circe-refined" % Versions.CirceRefined,
"com.chuusai" %%% "shapeless" % Versions.Shapeless,
"eu.timepit" %%% "refined" % Versions.Refined,
"org.typelevel" %%% "cats-core" % Versions.Cats,
"com.softwaremill.sttp.client3" %%% "core" % Versions.Sttp,
"com.softwaremill.sttp.client3" %%% "circe" % Versions.Sttp,
"com.softwaremill.sttp.client3" %%% "json-common" % Versions.Sttp,
"com.softwaremill.sttp.model" %%% "core" % Versions.SttpModel,
"com.softwaremill.sttp.shared" %%% "core" % Versions.SttpShared,
"co.fs2" %%% "fs2-core" % Versions.Fs2,
"org.scalatest" %%% "scalatest" % Versions.Scalatest % Test
)
)
.jsSettings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % Versions.ScalaJavaTime)
.jvmSettings(libraryDependencies ++= jvmGeometryDependencies.value)
lazy val clientJVM = client.jvm
lazy val clientJS = client.js