Skip to content
Snippets Groups Projects
Commit e9a4fe12 authored by Michael Armbrust's avatar Michael Armbrust Committed by Reynold Xin
Browse files

[BUILD] Add the ability to launch spark-shell from SBT.

Now you can quickly launch the spark-shell without building an assembly.  For quick development iteration run `build/sbt ~sparkShell` and calling exit will relaunch with any changes.

Author: Michael Armbrust <michael@databricks.com>

Closes #4438 from marmbrus/sparkShellSbt and squashes the following commits:

b4e44fe [Michael Armbrust] [BUILD] Add the ability to launch spark-shell from SBT.
parent 1390e56f
No related branches found
No related tags found
No related merge requests found
......@@ -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 =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment