mirror of https://github.com/sbt/sbt.git
Allow to specify Java options in the generated bootstraps
This commit is contained in:
parent
60f4d3b61d
commit
0b38b0bc00
|
|
@ -375,6 +375,10 @@ case class Bootstrap(
|
|||
@Value("key=value")
|
||||
@Short("P")
|
||||
property: List[String],
|
||||
@Help("Set Java command-line options in the generated launcher.")
|
||||
@Value("option")
|
||||
@Short("J")
|
||||
javaOpt: List[String],
|
||||
@Recurse
|
||||
isolated: IsolatedLoaderOptions,
|
||||
@Recurse
|
||||
|
|
@ -552,10 +556,10 @@ case class Bootstrap(
|
|||
|
||||
outputZip.close()
|
||||
|
||||
|
||||
// escaping of javaOpt possibly a bit loose :-|
|
||||
val shellPreamble = Seq(
|
||||
"#!/usr/bin/env sh",
|
||||
"exec java -jar \"$0\" \"$@\""
|
||||
"exec java -jar " + javaOpt.map(s => "'" + s.replace("'", "\\'") + "'").mkString(" ") + " \"$0\" \"$@\""
|
||||
).mkString("", "\n", "\n")
|
||||
|
||||
try NIOFiles.write(output0.toPath, shellPreamble.getBytes("UTF-8") ++ buffer.toByteArray)
|
||||
|
|
|
|||
Loading…
Reference in New Issue