Skip to content

Instantly share code, notes, and snippets.

@YordanGeorgiev
Last active April 25, 2019 11:33
Show Gist options
  • Save YordanGeorgiev/392254062804d353d69b35b8853808da to your computer and use it in GitHub Desktop.
Save YordanGeorgiev/392254062804d353d69b35b8853808da to your computer and use it in GitHub Desktop.
[build.sbt example for spark proj] how-to define build.sbt for a spark project #spark #scala #build.sbt #sbt
// add some stats for each test
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD")
// might or might not suits your reqs
fork in Test := true
// might or might not suit your reqs
parallelExecution in Test := false
// the verbosity level after issuing the sbt test command
logLevel in test := Level.Info
// do not print success msgs
showSuccess := false
// allocate more mem to the JVM
javaOptions ++= Seq("-Xms1G", "-Xmx4G", "-XX:+CMSClassUnloadingEnabled")
// Settings , Tools , check run on file save in idea
scalafmtOnCompile in ThisBuild := true
scalafmtTestOnCompile in ThisBuild := true
// print each test's score times ..
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD")
(sys.env.get("REPO_USR"), sys.env.get("REPO_PW")) match {
case (Some(usr), Some(pw)) =>
credentials += Credentials("Repo Realm", "corp.com", usr, pw)
case _ =>
println("[info] USERNAME and/or PASSWORD is missing for publishing to repo")
credentials ++= Seq()
}
// todo:ysg start remove ↓↓↓
// some useful code to remove later on, maybe ...
// todo:ysg stop remove ↑↑↑
// chk also global credentials file:
// repositories file ~/.sbt/repositories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment