-
Notifications
You must be signed in to change notification settings - Fork 45
/
build.sbt
210 lines (198 loc) · 7.84 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
/*
* This software is licensed under the Apache 2 license, quoted below.
*
* Copyright 2017-2019 Astraea, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* [http://www.apache.org/licenses/LICENSE-2.0]
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
* SPDX-License-Identifier: Apache-2.0
*
*/
// Leave me and my custom keys alone!
Global / lintUnusedKeysOnLoad := false
ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / dynverVTagPrefix := false
ThisBuild / dynverSonatypeSnapshots := true
ThisBuild / publishMavenStyle := true
ThisBuild / Test / publishArtifact := false
addCommandAlias("makeSite", "docs/makeSite")
addCommandAlias("previewSite", "docs/previewSite")
addCommandAlias("ghpagesPushSite", "docs/ghpagesPushSite")
addCommandAlias("console", "datasource/console")
// Prefer our own IntegrationTest config definition, which inherits from Test.
lazy val IntegrationTest = config("it") extend Test
lazy val root = project
.withId("RasterFrames")
.aggregate(core, datasource)
.settings(
publish / skip := true)
lazy val `rf-notebook` = project
.dependsOn(pyrasterframes)
.disablePlugins(CiReleasePlugin)
.enablePlugins(RFAssemblyPlugin, DockerPlugin)
.settings(
publish / skip := true)
lazy val core = project
.enablePlugins(BuildInfoPlugin)
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(Defaults.testSettings))
.settings(Defaults.itSettings)
.settings(
moduleName := "rasterframes",
libraryDependencies ++= Seq(
`slf4j-api`,
shapeless,
circe("core").value,
circe("generic").value,
circe("parser").value,
circe("generic-extras").value,
frameless excludeAll ExclusionRule(organization = "com.github.mpilquist"),
`jts-core`,
`spray-json`,
geomesa("z3").value,
geomesa("spark-jts").value,
spark("core").value % Provided,
spark("mllib").value % Provided,
spark("sql").value % Provided,
// TODO: scala-uri brings an outdated simulacrum dep
// Fix it in GT
geotrellis("spark").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
geotrellis("raster").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
geotrellis("s3").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
geotrellis("spark-testkit").value % Test excludeAll (
ExclusionRule(organization = "org.scalastic"),
ExclusionRule(organization = "org.scalatest"),
ExclusionRule(organization = "com.github.mpilquist")
),
scaffeine,
sparktestingbase().value % Test excludeAll ExclusionRule("org.scala-lang.modules", "scala-xml_2.12"),
`scala-logging`
),
libraryDependencies ++= {
val gv = rfGeoTrellisVersion.value
if (gv.startsWith("3")) Seq[ModuleID](
geotrellis("gdal").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
geotrellis("s3-spark").value excludeAll ExclusionRule(organization = "com.github.mpilquist")
)
else Seq.empty[ModuleID]
},
buildInfoKeys ++= Seq[BuildInfoKey](
version, scalaVersion, rfGeoTrellisVersion, rfGeoMesaVersion, rfSparkVersion
),
buildInfoPackage := "org.locationtech.rasterframes",
buildInfoObject := "RFBuildInfo",
buildInfoOptions := Seq(
BuildInfoOption.ToMap,
BuildInfoOption.ToJson
)
)
lazy val pyrasterframes = project
.dependsOn(core, datasource)
.disablePlugins(CiReleasePlugin)
.enablePlugins(RFAssemblyPlugin, PythonBuildPlugin)
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
geotrellis("s3").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
spark("core").value % Provided,
spark("mllib").value % Provided,
spark("sql").value % Provided
)
)
lazy val datasource = project
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.dependsOn(core % "test->test;compile->compile")
.settings(
moduleName := "rasterframes-datasource",
libraryDependencies ++= Seq(
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
compilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full),
sttpCatsCe2,
stac4s,
framelessRefined excludeAll ExclusionRule(organization = "com.github.mpilquist"),
geotrellis("s3").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
spark("core").value % Provided,
spark("mllib").value % Provided,
spark("sql").value % Provided,
`better-files`
),
Compile / console / scalacOptions ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) },
Test / console / scalacOptions ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) },
console / initialCommands := (console / initialCommands).value +
"""
|import org.locationtech.rasterframes.datasource.geotrellis._
|import org.locationtech.rasterframes.datasource.geotiff._
|""".stripMargin,
IntegrationTest / fork := true,
IntegrationTest / javaOptions := Seq("-Xmx3g -XX:+UseG1GC")
)
lazy val experimental = project
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.dependsOn(core % "test->test;it->test;compile->compile")
.dependsOn(datasource % "test->test;it->test;compile->compile")
.settings(
moduleName := "rasterframes-experimental",
libraryDependencies ++= Seq(
geotrellis("s3").value excludeAll ExclusionRule(organization = "com.github.mpilquist"),
spark("core").value % Provided,
spark("mllib").value % Provided,
spark("sql").value % Provided
),
IntegrationTest / fork := true,
IntegrationTest / javaOptions := (datasource / IntegrationTest / javaOptions).value
)
lazy val docs = project
.dependsOn(core, datasource, pyrasterframes)
.disablePlugins(CiReleasePlugin)
.enablePlugins(SiteScaladocPlugin, ParadoxPlugin, ParadoxMaterialThemePlugin, GhpagesPlugin, ScalaUnidocPlugin)
.settings(
publish / skip := true,
apiURL := Some(url("https://rasterframes.io/latest/api")),
autoAPIMappings := true,
ghpagesNoJekyll := true,
ScalaUnidoc / siteSubdirName := "latest/api",
paradox / siteSubdirName := ".",
paradoxProperties ++= Map(
"version" -> version.value,
"scaladoc.org.apache.spark.sql.rf" -> "https://rasterframes.io/latest",
"github.base_url" -> ""
),
paradoxNavigationExpandDepth := Some(3),
Compile / paradoxMaterialTheme ~= { _
.withRepository(uri("https://github.com/locationtech/rasterframes"))
.withCustomStylesheet("assets/custom.css")
.withCopyright("""© 2017-2021 <a href="https://astraea.earth">Astraea</a>, Inc. All rights reserved.""")
.withLogo("assets/images/RF-R.svg")
.withFavicon("assets/images/RasterFrames_32x32.ico")
.withColor("blue-grey", "light-blue")
.withGoogleAnalytics("UA-106630615-1")
},
makeSite := makeSite
.dependsOn(Compile / unidoc)
.dependsOn((Compile / paradox)
.dependsOn(pyrasterframes / doc)
).value,
Compile / paradox / sourceDirectories += (pyrasterframes / Python / doc / target).value,
)
.settings(
addMappingsToSiteDir(ScalaUnidoc / packageDoc / mappings, ScalaUnidoc / siteSubdirName)
)
.settings(
addMappingsToSiteDir(Compile / paradox / mappings, paradox / siteSubdirName)
)
lazy val bench = project
.disablePlugins(CiReleasePlugin)
.dependsOn(core % "compile->test")
.settings(publish / skip := true)