Skip to content

Instantly share code, notes, and snippets.

@lschuetze
Last active November 30, 2018 09:26
Show Gist options
  • Save lschuetze/bcbd0affc2a7b620a9e2a06f36e42dcc to your computer and use it in GitHub Desktop.
Save lschuetze/bcbd0affc2a7b620a9e2a06f36e42dcc to your computer and use it in GitHub Desktop.
Profiles with SBT (Scala Build Tool)
lazy val Profile = config("profile") extend(Runtime)
lazy val commonSettings = Seq(
organization := "organization",
version := "0.0.1",
scalaVersion := "2.12.0",
scalacOptions ++= Seq(
"-encoding", "utf8",
"-deprecation",
"-feature",
"-language:dynamics",
"-language:reflectiveCalls",
"-language:postfixOps",
"-language:implicitConversions",
"-unchecked",
"-target:jvm-1.8"),
fork := true,
javaHome := Some(file("/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home")),
javaOptions ++= Seq("-d64", "-Xms1024m", "-Xmx4048m")
)
lazy val main = (project in file("."))
.configs(Profile)
.settings(commonSettings: _*).
settings(
name := "benchmark",
libraryDependencies ++= Seq(
"xxx"
)
).
settings(inConfig(Profile)(Classpaths.configSettings ++ Defaults.configTasks ++ Defaults.resourceConfigPaths ++ Seq(
javaOptions ++= Seq(
"-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder",
"-XX:StartFlightRecording=settings=profiling-expensive",
"-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=."
))
): _*)
lazy val commonSettings = Seq(
organization := "organization",
version := "0.0.1",
scalaVersion := "2.12.0",
scalacOptions ++= Seq(
"-encoding", "utf8",
"-deprecation",
"-feature",
"-language:dynamics",
"-language:reflectiveCalls",
"-language:postfixOps",
"-language:implicitConversions",
"-unchecked",
"-target:jvm-1.8"),
fork := true,
javaHome := Some(file("/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home")),
javaOptions ++= Seq("-d64", "-Xms1024m", "-Xmx4048m")
)
lazy val main = (project in file("."))
.settings(commonSettings: _*).
settings(
name := "benchmark",
libraryDependencies ++= Seq(
"xxx"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment