diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-28 00:35:02 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-28 10:09:33 -0400 |
commit | 3232a1557aabd1ef3a59cbea38c883d4abb7ff32 (patch) | |
tree | 09ae92e35fe40b95143b0fb0291aff00f399bbc2 /stage1/resolver.scala | |
parent | a3e5f304e99ff47165af6ed20182f06700e15b33 (diff) | |
download | cbt-3232a1557aabd1ef3a59cbea38c883d4abb7ff32.tar.gz cbt-3232a1557aabd1ef3a59cbea38c883d4abb7ff32.tar.bz2 cbt-3232a1557aabd1ef3a59cbea38c883d4abb7ff32.zip |
add support for forking the jvm process when invoking a main class
and add example of using akka-http that doesn’t work without this.
Also add functionality to emulate inheritIO when running via nailgun
process. Only caveat right now: user has to press ENTER to terminate
the input strea.
Diffstat (limited to 'stage1/resolver.scala')
-rw-r--r-- | stage1/resolver.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stage1/resolver.scala b/stage1/resolver.scala index be4d278..6134a16 100644 --- a/stage1/resolver.scala +++ b/stage1/resolver.scala @@ -77,9 +77,17 @@ trait DependencyImplementation extends Dependency{ ) } */ + def fork = false def runMain( className: String, args: Seq[String] ): ExitCode = { + if(fork){ + val java_exe = new File(System.getProperty("java.home")) / "bin" / "java" + lib.runWithIO( + java_exe.string +: "-cp" +: classpath.string +: className +: args + ) + } else { lib.getMain( classLoader.loadClass( className ) )( args ) + } } def runMain( args: Seq[String] ): ExitCode = { |