This repository has been archived by the owner on Dec 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.sbt
77 lines (60 loc) · 2.29 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
import scala.xml.transform.{RewriteRule, RuleTransformer}
import scala.xml.{Comment, Elem, Node => XmlNode, NodeSeq => XmlNodeSeq}
name := "sparkannoy"
val versions = new {
val spark = "2.3.0"
val scalaTestingBase = s"${spark}_0.14.0"
val annoy4s = "0.9.0"
}
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % versions.spark % Provided,
"org.apache.spark" %% "spark-mllib" % versions.spark % Provided,
"com.holdenkarau" %% "spark-testing-base" % versions.scalaTestingBase % Test,
"net.pishen" %% "annoy4s" % versions.annoy4s % Test
)
organization := "com.github.mskimm"
isSnapshot := version.value.endsWith("-SNAPSHOT")
scalaVersion := "2.11.8"
sources in (Compile, doc) := Seq.empty
scalacOptions := Seq("-feature", "unchecked", "-encoding", "utf8")
homepage := Some(url("https://github.com/mskimm/sparkannoy"))
licenses := Seq(
"The Apache License, Version 2.0" -> url(
"http://www.apache.org/licenses/LICENSE-2.0.txt"))
description := "Building Annoy Index on Apache Spark"
scmInfo := Some {
val git = "https://github.com/mskimm/sparkannoy.git";
ScmInfo(url(git), s"scm:git:$git", Some(s"scm:git$git"))
}
developers := List(
Developer("mskimm",
"Min Seok Kim",
"mskim.org@gmail.com",
url("https://github.com/mskimm")))
publishTo := {
val maven = "https://oss.sonatype.org"
if (isSnapshot.value)
Some("Sonatype Snapshots" at s"$maven/content/repositories/snapshots")
else
Some("Sonatype Staging" at s"$maven/service/local/staging/deploy/maven2")
}
credentials ++= Seq(Path.userHome / ".ivy2" / ".credentials")
.filter(_.exists())
.map(Credentials.apply)
releasePublishArtifactsAction := PgpKeys.publishSigned.value
pomPostProcess := { (node: XmlNode) =>
new RuleTransformer(new RewriteRule {
override def transform(node: XmlNode): XmlNodeSeq = node match {
case e: Elem
if e.label == "dependency" && (e \ "scope")
.map(_.text)
.exists(Set("provided", "test").contains) =>
val Seq(organization, artifact, version, scope) =
Seq("groupId", "artifactId", "version", "scope").map(x =>
(e \ x).head.text)
Comment(
s"$scope dependency $organization#$artifact;$version has been omitted")
case _ => node
}
}).transform(node).head
}