Repository navigation
Expand file tree
/
Copy pathbuild.sbt
More file actions
123 lines (113 loc) · 3.92 KB
/
Copy pathbuild.sbt
File metadata and controls
123 lines (113 loc) · 3.92 KB
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
import scala.sys.process.Process
import xerial.sbt.Sonatype._
import Dependencies._
ThisBuild / organizationName := "zilliz"
ThisBuild / organizationHomepage := Some(url("https://zilliz.com/"))
// For cross-compiling (if applicable)
// crossScalaVersions := Seq("2.12.x", "2.13.x")
ThisBuild / scalaVersion := "2.13.16"
ThisBuild / description := "Milvus Spark Connector to use in Spark ETLs to populate a Milvus vector database."
ThisBuild / versionScheme := Some("early-semver")
// Remove all additional repository other than Maven Central from POM
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := {
val centralSnapshots =
"https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
}
ThisBuild / licenses := List(
"Server Side Public License v1" -> new URL(
"https://raw.githubusercontent.com/mongodb/mongo/refs/heads/master/LICENSE-Community.txt"
),
"GNU Affero General Public License v3 (AGPLv3)" -> new URL(
"https://www.gnu.org/licenses/agpl-3.0.txt"
)
)
ThisBuild / homepage := Some(
url("https://github.com/zilliztech/milvus-spark-connector")
)
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/zilliztech/milvus-spark-connector"),
"scm:git@github.com:zilliztech/milvus-spark-connector.git"
)
)
ThisBuild / developers := List(
Developer(
id = "simfg",
name = "SimFG",
email = "bang.fu@zilliz.com",
url = url("https://github.com/SimFG")
)
)
lazy val root = (project in file("."))
.settings(
name := "spark-connector",
version := "0.1.14-SNAPSHOT",
organization := "com.zilliz",
libraryDependencies ++= Seq(
munit % Test,
scalaTest % Test,
grpcNetty,
scalapbRuntime % "protobuf",
scalapbRuntimeGrpc,
scalapbCompilerPlugin,
sparkCore,
sparkSql,
sparkCatalyst,
sparkMLlib,
parquetHadoop,
hadoopCommon,
hadoopAws,
awsSdkS3,
jacksonScala,
jacksonDatabind
),
Compile / PB.protoSources += baseDirectory.value / "milvus-proto/proto",
Compile / PB.targets := Seq(
scalapb.gen(grpc = true) -> (Compile / sourceManaged).value / "scalapb"
),
Compile / unmanagedSourceDirectories += (
Compile / PB.targets
).value.head.outputPath,
Compile / packageBin / mappings ++= {
val base = (Compile / PB.targets).value.head.outputPath
(base ** "*.scala").get.map { file =>
file -> s"generated_protobuf/${file.relativeTo(base).getOrElse(file)}"
}
},
Compile / resourceDirectories += baseDirectory.value / "src" / "main" / "resources"
)
assembly / assemblyShadeRules := Seq(
ShadeRule.rename("com.google.protobuf.**" -> "shade_proto.@1").inAll,
ShadeRule.rename("com.google.common.**" -> "shade_googlecommon.@1").inAll
)
assembly / assemblyMergeStrategy := {
case PathList("native", xs @ _*) => MergeStrategy.first
// Handle all Netty native-image files
case PathList("META-INF", "native-image", "io.netty", _*) =>
MergeStrategy.discard
// Handle Netty version properties
case PathList("META-INF", "io.netty.versions.properties") =>
MergeStrategy.discard
// Handle mime.types
case PathList("mime.types") =>
MergeStrategy.filterDistinctLines
// Handle FastDoubleParser notice
case PathList("META-INF", "FastDoubleParser-NOTICE") =>
MergeStrategy.discard
// Handle module-info.class files
case x if x.endsWith("module-info.class") =>
MergeStrategy.discard
// Default case
case x =>
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}
// import scalapb.compiler.Version
// val grpcJavaVersion =
// SettingKey[String]("grpcJavaVersion", "ScalaPB gRPC Java version")
// grpcJavaVersion := Version.grpcJavaVersion
// See https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html for instructions on how to publish to Sonatype.