-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sbt
210 lines (196 loc) · 6.49 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
import xerial.sbt.Sonatype._
import Dependencies._
scalaVersion := Version.scala
scalaVersion in ThisBuild := Version.scala
lazy val commonSettings = Seq(
scalaVersion := Version.scala,
crossScalaVersions := Version.crossScala,
// We are overriding the default behavior of sbt-git which, by default,
// only appends the `-SNAPSHOT` suffix if there are uncommitted
// changes in the workspace.
version := {
// Avoid Cyclic reference involving error
if (git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value)
git.gitDescribedVersion.value.get + "-SNAPSHOT"
else
git.gitDescribedVersion.value.get
},
homepage := Some(url(Info.url)),
scmInfo := Some(ScmInfo(
url("https://github.com/geotrellis/geotrellis-contrib"), "scm:git:git@github.com:geotrellis/geotrellis-contrib.git"
)),
scalacOptions ++= Seq(
"-deprecation", "-unchecked", "-feature",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
"-language:postfixOps",
"-language:existentials",
"-language:experimental.macros",
"-Ypartial-unification" // Required by Cats
),
pomIncludeRepository := { _ => false },
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.4" cross CrossVersion.binary),
addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.1" cross CrossVersion.full),
resolvers ++= Seq(
Resolver.bintrayRepo("azavea", "geotrellis"),
"geosolutions" at "http://maven.geo-solutions.it/",
"locationtech-releases" at "https://repo.locationtech.org/content/groups/releases",
"locationtech-snapshots" at "https://repo.locationtech.org/content/groups/snapshots",
"osgeo" at "http://download.osgeo.org/webdav/geotools/",
"geotrellis-staging" at "https://oss.sonatype.org/service/local/repositories/orglocationtechgeotrellis-1009/content"
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val publishSettings = Seq(
organization := "com.azavea.geotrellis",
organizationName := "GeoTrellis",
organizationHomepage := Some(new URL("https://geotrellis.io/")),
description := "GeoTrellis Contrib is a place to put GeoTrellis projects that are not included in GeoTrellis Core for one reason or another.",
headerLicense := Some(HeaderLicense.ALv2("2019", "Azavea")),
publishArtifact in Test := false
) ++ sonatypeSettings ++ credentialSettings
lazy val sonatypeSettings = Seq(
publishMavenStyle := true,
sonatypeProfileName := "com.azavea",
sonatypeProjectHosting := Some(GitHubHosting(user="geotrellis", repository="geotrellis-contrib", email="systems@azavea.com")),
developers := List(
Developer(id = "echeipesh", name = "Eugene Cheipesh", email = "echeipesh@azavea.com", url = url("https://github.com/echeipesh")),
Developer(id = "pomadchin", name = "Grigory Pomadchin", email = "gpomadchin@azavea.com", url = url("https://github.com/pomadchin"))
),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
publishTo := sonatypePublishTo.value
)
lazy val credentialSettings = Seq(
credentials += Credentials(
"GnuPG Key ID",
"gpg",
System.getenv().get("GPG_KEY_ID"),
"ignored"
),
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
System.getenv().get("SONATYPE_USERNAME"),
System.getenv().get("SONATYPE_PASSWORD")
)
)
lazy val root = Project("geotrellis-contrib", file("."))
.aggregate(vlm, gdal, slick)
.settings(commonSettings: _*)
.settings(noPublishSettings)
lazy val IntegrationTest = config("it") extend Test
lazy val vlm = project
.settings(commonSettings)
.settings(publishSettings)
.settings(
organization := "com.azavea.geotrellis",
name := "geotrellis-contrib-vlm",
libraryDependencies ++= Seq(
geotrellisSpark,
geotrellisS3,
geotrellisUtil,
scalactic,
scalaURI,
squants,
catsPar,
sparkCore % Provided,
sparkSQL % Test,
geotrellisSparkTestkit % Test,
geotrellisRasterTestkit % Test,
scalatest % Test
),
// caused by the AWS SDK v2
dependencyOverrides ++= {
val deps = Seq(
jacksonCore,
jacksonDatabind,
jacksonAnnotations
)
CrossVersion.partialVersion(scalaVersion.value) match {
// if Scala 2.12+ is used
case Some((2, scalaMajor)) if scalaMajor >= 12 => deps
case _ => deps :+ jacksonModuleScala
}
},
Test / fork := true,
Test / parallelExecution := false,
Test / testOptions += Tests.Argument("-oDF")
)
.settings(
initialCommands in console :=
"""
|import geotrellis.contrib.vlm.effect._
""".stripMargin
)
lazy val gdal = project
.dependsOn(vlm)
.settings(commonSettings)
.settings(publishSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
organization := "com.azavea.geotrellis",
name := "geotrellis-contrib-gdal",
libraryDependencies ++= Seq(
geotrellisGDAL,
sparkCore % Provided,
sparkSQL % Test,
geotrellisSparkTestkit % Test,
geotrellisRasterTestkit % Test,
scalatest % Test,
gdalBindings % Test
),
// caused by the AWS SDK v2
dependencyOverrides ++= {
val deps = Seq(
jacksonCore,
jacksonDatabind,
jacksonAnnotations
)
CrossVersion.partialVersion(scalaVersion.value) match {
// if Scala 2.12+ is used
case Some((2, scalaMajor)) if scalaMajor >= 12 => deps
case _ => deps :+ jacksonModuleScala
}
},
Test / fork := true,
Test / parallelExecution := false,
Test / testOptions += Tests.Argument("-oDF"),
javaOptions ++= Seq("-Djava.library.path=/usr/local/lib")
)
.settings(
initialCommands in console :=
"""
|import geotrellis.contrib.vlm.gdal.effect._
""".stripMargin
)
lazy val slick = project
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
organization := "com.azavea.geotrellis",
name := "geotrellis-contrib-slick",
libraryDependencies ++= Seq(
"org.locationtech.geotrellis" %% "geotrellis-vector" % "2.3.1",
slickPG,
scalatest % Test
)
)
.settings(crossScalaVersions := Seq(scalaVersion.value))
lazy val benchmark = (project in file("benchmark"))
.dependsOn(vlm)
.settings(commonSettings: _*)
.settings(noPublishSettings)
.enablePlugins(JmhPlugin)
.settings(
name := "benchmark",
fork := true,
libraryDependencies ++= Seq(
sparkCore
)
)