-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild.sbt
201 lines (175 loc) · 5.89 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
import xerial.sbt.Sonatype._
import Dependencies._
val mainVersion = "0.8.0-SNAPSHOT"
lazy val qbeastCore = (project in file("./core"))
.settings(
name := "qbeast-core",
libraryDependencies ++= Seq(sparkCore % Provided, sparkSql % Provided, sparkml % Provided),
Test / parallelExecution := false,
assembly / test := {},
assembly / assemblyOption := (assembly / assemblyOption).value.copy(includeScala = false))
.settings(noWarningInConsole)
lazy val qbeastDelta = (project in file("./delta"))
.dependsOn(qbeastCore)
.settings(
name := "qbeast-delta",
libraryDependencies ++= Seq(sparkCore % Provided, deltaSpark % Provided, sparkSql % Provided),
Test / parallelExecution := false,
assembly / test := {},
assembly / assemblyOption := (assembly / assemblyOption).value.copy(includeScala = false))
.settings(noWarningInConsole)
lazy val qbeastSpark = (project in file("."))
.dependsOn(qbeastCore, qbeastDelta)
.enablePlugins(ScalaUnidocPlugin)
.settings(
name := "qbeast-spark",
libraryDependencies ++= Seq(
sparkCore % Provided,
sparkSql % Provided,
deltaSpark % Provided,
sparkml % Test,
hadoopAws % Test),
Test / parallelExecution := false,
assembly / test := {},
assembly / assemblyOption := (assembly / assemblyOption).value.copy(includeScala = false))
.settings(noWarningInConsole)
qbeastCore / Compile / doc / scalacOptions ++= Seq(
"-doc-title",
"qbeast-core",
"-doc-version",
mainVersion,
"-doc-footer",
"Copyright 2022 Qbeast - Docs for version " + mainVersion + " of qbeast-core")
qbeastSpark / Compile / doc / scalacOptions ++= Seq(
"-doc-title",
"qbeast-spark",
"-doc-version",
mainVersion,
"-doc-footer",
"Copyright 2022 Qbeast - Docs for version " + mainVersion + " of qbeast-spark")
qbeastDelta / Compile / doc / scalacOptions ++= Seq(
"-doc-title",
"qbeast-delta",
"-doc-version",
mainVersion,
"-doc-footer",
"Copyright 2022 Qbeast - Docs for version " + mainVersion + " of qbeast-delta")
// Common metadata
ThisBuild / version := mainVersion
ThisBuild / organization := "io.qbeast"
ThisBuild / organizationName := "Qbeast Analytics, S.L."
ThisBuild / organizationHomepage := Some(url("https://qbeast.io/"))
ThisBuild / startYear := Some(2021)
ThisBuild / libraryDependencies ++= Seq(
fasterxml % Provided,
sparkFastTests % Test,
scalaTest % Test,
mockito % Test)
Test / javaOptions ++= Seq("-Xmx10G", "-XX:+UseG1GC")
Test / testOptions += Tests.Argument("-oD")
Test / fork := true
// Scala compiler settings
ThisBuild / scalaVersion := "2.12.18"
ThisBuild / scalacOptions ++= Seq(
"-encoding",
"UTF-8",
"-target:jvm-1.8",
"-Xfatal-warnings",
"-feature",
"-language:postfixOps",
"-deprecation",
"-unchecked",
"-Xlint")
// Java compiler settings
ThisBuild / javacOptions ++= Seq(
"-encoding",
"UTF-8",
"-source",
"1.8",
"-target",
"1.8",
"-Werror",
"-g",
"-Xlint",
"-Xdoclint:all/package")
// this setting remove warning when using the sbt console
lazy val noWarningInConsole = Seq(
Compile / console / scalacOptions ~= {
_.filterNot(
Set("-Ywarn-unused-import", "-Ywarn-unused:imports", "-Xlint", "-Xfatal-warnings"))
},
Test / console / scalacOptions := (Compile / console / scalacOptions).value)
// Dependency repositories
ThisBuild / resolvers ++= Seq(Resolver.mavenLocal, Resolver.mavenCentral)
// Repository for maven (Tagged releases on Maven Central using Sonatype)
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / sonatypeRepository := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value) nexus + "content/repositories/snapshots"
else nexus + "service/local"
}
ThisBuild / publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else sonatypePublishToBundle.value
}
// Sonatype settings
ThisBuild / publishMavenStyle.withRank(KeyRanks.Invisible) := true
ThisBuild / sonatypeProfileName := "io.qbeast"
ThisBuild / sonatypeProjectHosting := Some(
GitHubHosting(user = "Qbeast-io", repository = "qbeast-spark", email = "[email protected]"))
ThisBuild / licenses := Seq("APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / homepage := Some(url("https://qbeast.io/"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/Qbeast-io/qbeast-spark"),
"scm:[email protected]:Qbeast-io/qbeast-spark.git"))
ThisBuild / pomExtra :=
<developers>
<developer>
<id>alexeiakimov</id>
<name>Alexey Akimov</name>
<url>https://github.com/alexeiakimov</url>
</developer>
<developer>
<id>cugni</id>
<name>Cesare Cugnasco</name>
<url>https://github.com/cugni</url>
</developer>
<developer>
<id>eavilaes</id>
<name>Eric Avila</name>
<url>https://github.com/eavilaes</url>
</developer>
<developer>
<id>Jiaweihu08</id>
<name>Jiawei Hu</name>
<url>https://github.com/Jiaweihu08</url>
</developer>
<developer>
<id>osopardo1</id>
<name>Paola Pardo</name>
<url>https://github.com/osopardo1</url>
</developer>
<developer>
<id>polsm91</id>
<name>Pol Santamaria</name>
<url>https://github.com/polsm91</url>
</developer>
<developer>
<id>Adricu8</id>
<name>Adria Correas</name>
<url>https://github.com/Adricu8</url>
</developer>
</developers>
// Scalafmt settings
Compile / compile := (Compile / compile).dependsOn(Compile / scalafmtCheck).value
Test / compile := (Test / compile).dependsOn(Test / scalafmtCheck).value
// Scalafix settings
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
// Header settings
headerLicense := Some(HeaderLicense.ALv2("2021", "Qbeast Analytics, S.L."))
headerEmptyLine := false
Compile / compile := (Compile / compile).dependsOn(Compile / headerCheck).value