-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sbt
121 lines (108 loc) · 3.39 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
import Dependencies._
name := "mmw-geoprocessing"
organization := "org.wikiwatershed"
licenses := Seq(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")
)
scalaVersion := Version.scala
ThisBuild / scalaVersion := Version.scala
ThisBuild / version := "6.1.0"
lazy val root = Project("mmw-geoprocessing", file("."))
.aggregate(
api
)
lazy val api = project
.settings(commonSettings ++ apiDependencies ++ consoleSettings)
lazy val scalacOpts = Seq(
"-deprecation",
"-unchecked",
"-feature",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
"-language:postfixOps",
"-language:existentials",
"-Yrangepos"
)
lazy val apiDependencies = Seq(
libraryDependencies ++= Seq(
akkaActor,
akkaHttp,
akkaHttpSprayJson,
akkaStream,
logging,
scalaParallel,
scalatest % Test,
scalactic % Test,
geotrellisS3,
geotrellisGdal,
geotrellisRaster,
geotrellisVector
)
)
lazy val commonSettings = Seq(
evictionErrorLevel := Level.Warn,
Compile / scalacOptions ++= scalacOpts,
Compile / console / scalacOptions -= "-Ywarn-unused-import",
unmanagedSources / excludeFilter := ".#*.scala",
publishMavenStyle := true,
Test / publishArtifact := false,
pomIncludeRepository := { _ =>
false
},
resolvers ++= Seq(
"GeoSolutions" at "https://maven.geo-solutions.it/",
"LT-releases" at "https://repo.locationtech.org/content/groups/releases",
"OSGeo" at "https://repo.osgeo.org/repository/release/",
"maven2" at "https://repo1.maven.org/maven2"
),
assembly / assemblyShadeRules := {
val shadePackage = "org.wikiwatershed.shaded"
Seq(
ShadeRule.rename("cats.kernel.**" -> s"$shadePackage.cats.kernel.@1").inAll
)
},
Test / fork := true,
Test / parallelExecution := false,
Test / testOptions += Tests.Argument("-oD"),
Test / javaOptions ++= Seq("-Xms1024m", "-Xmx8144m", "-Djts.overlay=ng"),
// Settings for sbt-assembly plugin which builds fat jars for use by spark jobs
assembly / test := {},
assembly / assemblyMergeStrategy := {
case "reference.conf" => MergeStrategy.concat
case "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 consoleSettings = Seq(
// auto imports for local SBT console
// can be used with `test:console` command
console / initialCommands :=
"""
import geotrellis.raster._
import geotrellis.vector._
import geotrellis.vector.io._
import geotrellis.vector.io.wkt.WKT
"""
)