-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.sbt
208 lines (182 loc) · 7.53 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
import xerial.sbt.Sonatype._
import Dependencies._
lazy val commonSettings = Seq(
// 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
},
cancelable in Global := true,
scalaVersion in ThisBuild := Version.scala2_11,
crossScalaVersions := Seq(Version.scala2_11, Version.scala2_12),
scalacOptions := Seq(
"-deprecation",
"-unchecked",
"-feature",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
"-language:postfixOps",
"-language:existentials",
"-language:experimental.macros",
"-feature",
"-Ywarn-dead-code",
"-Ypartial-unification",
"-Ypatmat-exhaust-depth", "100",
"-Ywarn-unused-import"
),
scalacOptions in (Compile, doc) += "-groups",
scalacOptions in (Compile, console) ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) },
/* For Monocle's Lens auto-generation */
addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full),
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.bintrayRepo("lonelyplanet", "maven"),
Resolver.bintrayRepo("kwark", "maven"), // Required for Slick 3.1.1.2, see https://github.com/azavea/raster-foundry/pull/1576
Resolver.bintrayRepo("bkirwi", "maven"), // Required for `decline` dependency
"eclipse-releases" at "https://repo.eclipse.org/content/groups/releases",
"eclipse-snapshots" at "https://repo.eclipse.org/content/groups/snapshots",
"geosolutions" at "http://maven.geo-solutions.it/",
"osgeo-releases" at "https://repo.osgeo.org/repository/release/",
"apache.commons.io" at "https://mvnrepository.com/artifact/commons-io/commons-io"
),
updateOptions := updateOptions.value.withGigahorse(false),
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
assemblyMergeStrategy in assembly := {
case "reference.conf" | "application.conf" => MergeStrategy.concat
case PathList("META-INF", xs@_*) =>
xs match {
case ("MANIFEST.MF" :: Nil) => MergeStrategy.discard
// Concatenate everything in the services directory to keep GeoTools happy.
case ("services" :: _ :: Nil) =>
MergeStrategy.concat
// Concatenate these to keep JAI happy.
case ("javax.media.jai.registryFile.jai" :: Nil) | ("registryFile.jai" :: Nil) | ("registryFile.jaiext" :: Nil) =>
MergeStrategy.concat
case (name :: Nil) => {
// Must exclude META-INF/*.([RD]SA|SF) to avoid "Invalid signature file digest for Manifest main attributes" exception.
if (name.endsWith(".RSA") || name.endsWith(".DSA") || name.endsWith(".SF"))
MergeStrategy.discard
else
MergeStrategy.first
}
case _ => MergeStrategy.first
}
case _ => MergeStrategy.first
}
)
lazy val publishSettings = Seq(
organization := "com.azavea.geotrellis",
organizationName := "GeoTrellis",
organizationHomepage := Some(new URL("https://geotrellis.io/")),
description := "Import OSM data and output to VectorTiles with GeoTrellis.",
publishArtifact in Test := false
) ++ sonatypeSettings ++ credentialSettings
lazy val sonatypeSettings = Seq(
publishMavenStyle := true,
sonatypeProfileName := "com.azavea",
sonatypeProjectHosting := Some(GitHubHosting(user="geotrellis", repository="vectorpipe", email="systems@azavea.com")),
developers := List(
Developer(id = "jpolchlo", name = "Justin Polchlopek", email = "jpolchlopek@azavea.com", url = url("https://github.com/jpolchlo")),
Developer(id = "mojodna", name = "Seth Fitzsimmons", email = "seth@mojodna.net", url = url("https://github.com/mojodna"))
),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
publishTo := sonatypePublishTo.value
)
lazy val credentialSettings = Seq(
credentials ++= List(
for {
id <- sys.env.get("GPG_KEY_ID")
} yield Credentials("GnuPG Key ID", "gpg", id, "ignored")
,
for {
user <- sys.env.get("SONATYPE_USERNAME")
pass <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass)
).flatten
)
val vpExtraSettings = Seq(
libraryDependencies ++= Seq(
// gtGeomesa exclude("com.google.protobuf", "protobuf-java") exclude("org.locationtech.geomesa",
// "geomesa-accumulo-datastore"),
gtGeotools exclude ("com.google.protobuf", "protobuf-java"),
awscala,
scalaj,
sparkHive % Provided,
sparkSql % Provided,
sparkJts,
gtS3 exclude ("com.google.protobuf", "protobuf-java") exclude ("com.amazonaws", "aws-java-sdk-s3"),
gtS3Spark exclude ("com.google.protobuf", "protobuf-java") exclude ("com.amazonaws", "aws-java-sdk-s3"),
gtSpark exclude ("com.google.protobuf", "protobuf-java"),
gtVectorTile exclude ("com.google.protobuf", "protobuf-java"),
decline,
jaiCore from "http://download.osgeo.org/webdav/geotools/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar",
gtVector,
cats,
scalactic,
scalatest,
circeCore,
circeGeneric,
circeExtras,
circeParser,
circeOptics,
circeJava8,
circeYaml,
"com.softwaremill.macmemo" %% "macros" % "0.4",
"com.amazonaws" % "aws-java-sdk-s3" % "1.11.518" % Provided
),
dependencyOverrides ++= {
val deps = Seq(
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.7",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.7",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.7"
)
CrossVersion.partialVersion(scalaVersion.value) match {
// if Scala 2.12+ is used
case Some((2, scalaMajor)) if scalaMajor >= 12 => deps
case _ => deps :+ "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.6.7"
}
},
test in assembly := {},
assemblyJarName in assembly := "vectorpipe.jar",
Test / fork := true,
Test / baseDirectory := (baseDirectory.value).getParentFile,
Test / parallelExecution := false,
Test / testOptions += Tests.Argument("-oDF"),
)
// /* Microsite Settings
// *
// * To generate the microsite locally, use `sbt makeMicrosite`.
// * To publish the site to Github, use `sbt publishMicrosite`.
// *
// * Spark deps must not be marked `provided` while doing these, or you will get errors.
// */
// enablePlugins(MicrositesPlugin)
// enablePlugins(SiteScaladocPlugin)
// micrositeName := "VectorPipe"
// micrositeDescription := "Convert Vector data into VectorTiles"
// micrositeAuthor := "GeoTrellis Team at Azavea"
// micrositeGitterChannel := false
// micrositeOrganizationHomepage := "https://www.azavea.com/"
// micrositeGithubOwner := "geotrellis"
// micrositeGithubRepo := "vectorpipe"
// micrositeBaseUrl := "/vectorpipe"
// micrositeDocumentationUrl := "/vectorpipe/latest/api/#vectorpipe.package" /* Location of Scaladocs */
/* Main project */
lazy val vectorpipe = project
.in(file("."))
.settings(moduleName := "vectorpipe", commonSettings, publishSettings, vpExtraSettings/*, release*/)
/* Benchmarking suite.
* Benchmarks can be executed by first switching to the `bench` project and then by running:
jmh:run -t 1 -f 1 -wi 5 -i 5 .*Bench.*
*/
lazy val bench = project
.in(file("bench"))
.settings(commonSettings)
.dependsOn(vectorpipe)
.enablePlugins(JmhPlugin)