Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add SparkR build support for SBT.
  • Loading branch information
sarutak committed Apr 22, 2021
commit 77a8d4541ac9a2efef093ba9bba093354ee49ff5
20 changes: 20 additions & 0 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ object SparkBuild extends PomBuild {

enable(YARN.settings)(yarn)

if (profiles.contains("sparkr")) {
enable(SparkR.settings)(core)
}

/**
* Adds the ability to run the spark shell directly from SBT without building an assembly
* jar.
Expand Down Expand Up @@ -888,6 +892,22 @@ object PySparkAssembly {

}

object SparkR {
import scala.sys.process.Process

val buildRPackage = taskKey[Unit]("Build the R package")
lazy val settings = Seq(
buildRPackage := {
val command = baseDirectory.value / ".." / "R" / "install-dev.sh"
Process(command.toString).!!
},
(Compile / compile) := {
buildRPackage.value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we build SparkR after the compilation of core so the order should probably be switched with the next line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've updated.

(Compile / compile).value
}
)
}

object Unidoc {

import BuildCommons._
Expand Down