-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathbuild.sbt
125 lines (102 loc) · 3.74 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
import com.typesafe.sbt.SbtGit.{GitKeys => git}
name in ThisBuild := "spark-ext"
organization in ThisBuild := "com.collective.sparkext"
scalaVersion in ThisBuild := "2.11.7"
crossScalaVersions in ThisBuild := Seq("2.10.6", "2.11.7")
scalacOptions in ThisBuild ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked"
//"-Ywarn-unused-import" // turn on whenever you want to discover unused imports, 2.11+
//"-Xfuture"
//"-Xlint",
//"-Ywarn-value-discard"
)
// compiler optimization (2.11+ only)
// still experimental
// scalacOptions += "-Ybackend:o3"
licenses in ThisBuild += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
scalastyleFailOnError in ThisBuild := true
maxErrors in ThisBuild := 5
shellPrompt in ThisBuild := ShellPrompt.buildShellPrompt
resolvers in ThisBuild ++= Seq(
// Maven local
Resolver.mavenLocal,
// Cloudera
"Cloudera" at "https://repository.cloudera.com/artifactory/cloudera-repos/",
// Typesafe
Resolver.typesafeRepo("releases"),
Resolver.typesafeRepo("snapshots"),
Resolver.typesafeIvyRepo("releases"),
Resolver.typesafeIvyRepo("snapshots"),
// Sonatype
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots"),
// Scalaz
"Scalaz Bintray Repo" at "https://dl.bintray.com/scalaz/releases",
// Apache
"Apache Releases" at "https://repository.apache.org/content/repositories/releases/",
"Apache Staging" at "https://repository.apache.org/content/repositories/staging",
"Apache Snapshots" at "https://repository.apache.org/content/repositories/snapshots",
// Conjars
"Conjars" at "http://conjars.org/repo",
// Collective
"Collective Bintray" at "https://dl.bintray.com/collectivemedia/releases"
)
// Spark Ext Project
def SparkExtProject(path: String) =
Project(path, file(path))
.settings(net.virtualvoid.sbt.graph.Plugin.graphSettings: _*)
.settings(TestSettings.testSettings: _*)
.settings(bintrayRepository := "releases")
.settings(bintrayOrganization := Some("collectivemedia"))
.settings(
apiMappings ++= {
val cp: Seq[Attributed[File]] = (fullClasspath in Test).value
def findManagedDependency(organization: String, name: String): File = {
cp.foreach(println)
( for {
entry <- cp
module <- entry.get(moduleID.key)
if module.organization == organization
if module.name.startsWith(name)
jarFile = entry.data
} yield jarFile
).head
}
Map(
findManagedDependency("org.apache.spark", "spark") -> url("https://spark.apache.org/docs/latest/api/scala/")
)
}
)
// Aggregate all projects & disable publishing root project
lazy val root = Project("spark-ext", file(".")).
settings(publish :=()).
settings(publishLocal :=()).
settings(unidocSettings: _*).
settings(unidocSettings: _*).
settings(site.settings ++ ghpages.settings: _*).
settings(
autoAPIMappings := true,
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "/"),
git.gitRemoteRepo := "[email protected]:collectivemedia/spark-ext.git"
).
aggregate(sparkextSql, sparkextMllib, sparkextTest, sparkextExample)
// Spark Ext Projects
lazy val sparkextSql =
SparkExtProject("sparkext-sql")
.dependsOn(sparkextTest % "test->test")
lazy val sparkextMllib =
SparkExtProject("sparkext-mllib")
.dependsOn(sparkextSql)
.dependsOn(sparkextTest % "test->test")
lazy val sparkextTest =
SparkExtProject("sparkext-test")
.settings(publish :=())
.settings(publishLocal :=())
lazy val sparkextExample =
SparkExtProject("sparkext-example")
.dependsOn(sparkextMllib)
.settings(publish :=())
.settings(publishLocal :=())