forked from Qbeast-io/qbeast-spark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
167 lines (152 loc) · 4.92 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
import Dependencies._
import xerial.sbt.Sonatype._
val mainVersion = "0.3.1"
lazy val qbeastCore = (project in file("core"))
.settings(
name := "qbeast-core",
version := mainVersion,
libraryDependencies ++= Seq(apacheCommons % Test))
// Projects
lazy val qbeastSpark = (project in file("."))
.enablePlugins(ScalaUnidocPlugin)
.dependsOn(qbeastCore)
.settings(
name := "qbeast-spark",
libraryDependencies ++= Seq(
sparkCore % Provided,
sparkSql % Provided,
hadoopClient % Provided,
deltaCore % Provided,
amazonAws % Test,
hadoopCommons % Test,
hadoopAws % Test),
Test / parallelExecution := false,
assembly / test := {},
assembly / assemblyOption := (assembly / assemblyOption).value.copy(includeScala = false),
publish / skip := true)
.settings(noWarningInConsole)
qbeastSpark / Compile / doc / scalacOptions ++= Seq(
"-doc-title",
"qbeast-spark",
"-doc-version",
mainVersion,
"-doc-footer",
"Copyright 2022 Qbeast - Docs for version " + mainVersion + " of qbeast-spark")
// 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 += "-Xmx2G"
Test / fork := true
// Scala compiler settings
ThisBuild / scalaVersion := "2.12.12"
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 := 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
// Scalastyle settings
Compile / compile := (Compile / compile).dependsOn((Compile / scalastyle).toTask("")).value
Test / compile := (Test / compile).dependsOn((Test / scalastyle).toTask("")).value
// Header settings
headerLicense := Some(HeaderLicense.Custom("Copyright 2021 Qbeast Analytics, S.L."))
headerEmptyLine := false
Compile / compile := (Compile / compile).dependsOn(Compile / headerCheck).value