aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rw-r--r--project/SparkBuild.scala23
1 files changed, 23 insertions, 0 deletions
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 5e3051c091..95f8dfa3d2 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -177,6 +177,29 @@ object SparkBuild extends PomBuild {
enable(Flume.settings)(streamingFlumeSink)
+
+ /**
+ * Adds the ability to run the spark shell directly from SBT without building an assembly
+ * jar.
+ *
+ * Usage: `build/sbt sparkShell`
+ */
+ val sparkShell = taskKey[Unit]("start a spark-shell.")
+
+ enable(Seq(
+ connectInput in run := true,
+ fork := true,
+ outputStrategy in run := Some (StdoutOutput),
+
+ javaOptions ++= Seq("-Xmx2G", "-XX:MaxPermSize=1g"),
+
+ sparkShell := {
+ (runMain in Compile).toTask(" org.apache.spark.repl.Main -usejavacp").value
+ }
+ ))(assembly)
+
+ enable(Seq(sparkShell := sparkShell in "assembly"))(spark)
+
// TODO: move this to its upstream project.
override def projectDefinitions(baseDirectory: File): Seq[Project] = {
super.projectDefinitions(baseDirectory).map { x =>