Created
January 13, 2016 22:55
-
-
Save labe-me/12a297538ea319b32b90 to your computer and use it in GitHub Desktop.
Enabling DCEVM and Hotswap Agent in SBT + sbt-revolver plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val hotswapAgentJarPath = Def.settingKey[Option[String]]("Path to hotswap-agent.jar, enables DCEVM in run and reStart") | |
// set hotswapAgentJarPath := Some("/Users/lbedubourg/local/hotswap-agent.jar") | |
hotswapAgentJarPath := sys.env.get("HOTSWAP_AGENT_JAR") | |
def hotswapJavaOptions(path: Option[String]) = path match { | |
case None => Seq() | |
case Some(p) => Seq("-XXaltjvm=dcevm", s"-javaagent:${p}=autoHotswap=true") | |
} | |
// fork is required to get a new jvm with our custom args | |
fork in run := true | |
// add DCEVM jvm args to run task when hotswapAgentJarPath is defined | |
javaOptions in run <++= hotswapAgentJarPath map hotswapJavaOptions | |
// add DCEVM jvm args to sbt-revolver reStart task when hotswapAgentJarPath is defined | |
javaOptions in reStart <++= hotswapAgentJarPath map hotswapJavaOptions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment