/
build.sbt
161 lines (132 loc) · 5.65 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
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
name := "spark-lucenerdd"
organization := "org.zouzias"
scalaVersion := "2.12.18"
crossScalaVersions := Seq("2.12.18")
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
homepage := Some(url("https://github.com/zouzias/spark-lucenerdd"))
scalacOptions ++= Seq("-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-language:implicitConversions")
javacOptions ++= Seq("-Xlint",
"-Xms512M",
"-Xmx2048M",
"-XX:MaxPermSize=2048M",
"-XX:+CMSClassUnloadingEnabled"
)
// Add jcenter repo
resolvers += Resolver.jcenterRepo
resolvers += "Apache Repos" at "https://repository.apache.org/content/repositories/releases"
releaseCrossBuild := false
releasePublishArtifactsAction := PgpKeys.publishSigned.value
publishMavenStyle := true
sonatypeProfileName := "org.zouzias"
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
}
else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
}
Test / publishArtifact := false
pomIncludeRepository := { _ => false }
pomExtra := <scm>
<url>git@github.com:zouzias/spark-lucenerdd.git</url>
<connection>scm:git:git@github.com:zouzias/spark-lucenerdd.git</connection>
</scm>
<developers>
<developer>
<id>zouzias</id>
<name>Anastasios Zouzias</name>
<url>https://github.com/zouzias</url>
</developer>
</developers>
val luceneV = "8.11.2"
val sparkVersion = "3.5.1"
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
// scalastyle:off
val scalactic = "org.scalactic" %% "scalactic" % "3.2.17"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.17" % "test"
val joda_time = "joda-time" % "joda-time" % "2.12.5"
val algebird = "com.twitter" %% "algebird-core" % "0.13.10"
val joda_convert = "org.joda" % "joda-convert" % "2.2.3"
val spatial4j = "org.locationtech.spatial4j" % "spatial4j" % "0.8"
val typesafe_config = "com.typesafe" % "config" % "1.3.4"
val lucene_facet = "org.apache.lucene" % "lucene-facet" % luceneV
val lucene_analyzers = "org.apache.lucene" % "lucene-analyzers-common" % luceneV
val lucene_query_parsers = "org.apache.lucene" % "lucene-queryparser" % luceneV
val lucene_expressions = "org.apache.lucene" % "lucene-expressions" % luceneV
val lucene_spatial_extras = "org.apache.lucene" % "lucene-spatial-extras" % luceneV
val jts = "org.locationtech.jts" % "jts-core" % "1.19.0"
// scalastyle:on
libraryDependencies ++= Seq(
algebird,
lucene_facet,
lucene_analyzers,
lucene_expressions,
lucene_query_parsers,
typesafe_config,
lucene_spatial_extras,
spatial4j,
jts,
joda_time,
joda_convert, // To avoid warning: Class org.joda.convert.ToString not found
scalactic, // scalactic is recommended, see http://www.scalatest.org/install
scalatest
)
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.apache.spark" %% "spark-mllib" % sparkVersion % "provided",
"com.holdenkarau" %% "spark-testing-base" % s"3.5.0_1.4.7" % "test" intransitive(),
"org.scala-lang" % "scala-library" % scalaVersion.value % "compile"
)
// Read version in code from build.sbt
lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin).
settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
// See https://github.com/sbt/sbt-buildinfo#buildinfooptionbuildtime
buildInfoOptions += BuildInfoOption.BuildTime,
// https://github.com/sbt/sbt-buildinfo#buildinfooptiontomap
buildInfoOptions += BuildInfoOption.ToMap,
buildInfoPackage := "org.zouzias.spark.lucenerdd"
)
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := scalastyle.in(Compile).toTask("").value
(compile in Compile) := ((compile in Compile) dependsOn compileScalastyle).value
Test / parallelExecution := false
// Skip tests during assembly
assembly / test := {}
// To avoid merge issues
assembly / assemblyMergeStrategy := {
case PathList("module-info.class", xs @ _*) => MergeStrategy.first
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}