Merge pull request #457 from alexarchambault/topic/tweak-launcher

Tweak launcher
This commit is contained in:
Alexandre Archambault 2017-03-14 16:47:18 +01:00 committed by GitHub
commit 14f297b4f7
2 changed files with 21 additions and 1 deletions

View File

@ -230,6 +230,17 @@ lazy val cli = project
}, },
packExcludeArtifactTypes += "pom", packExcludeArtifactTypes += "pom",
resourceGenerators in Compile += packageBin.in(bootstrap).in(Compile).map { jar => resourceGenerators in Compile += packageBin.in(bootstrap).in(Compile).map { jar =>
import java.nio.file.Files
import java.nio.charset.StandardCharsets
val content = Files.readAllBytes(jar.toPath)
val header =
"""#!/usr/bin/env sh
|exec java $JAVA_OPTS -noverify -jar "$0" "$@"
""".stripMargin
Files.write(jar.toPath, header.getBytes(StandardCharsets.UTF_8) ++ content)
Seq(jar) Seq(jar)
}.taskValue, }.taskValue,
ProguardKeys.proguardVersion in Proguard := "5.3", ProguardKeys.proguardVersion in Proguard := "5.3",
@ -479,6 +490,9 @@ lazy val okhttp = project
) )
) )
lazy val echo = project
.settings(commonSettings)
lazy val jvm = project lazy val jvm = project
.aggregate( .aggregate(
coreJvm, coreJvm,
@ -491,7 +505,8 @@ lazy val jvm = project
`sbt-launcher`, `sbt-launcher`,
doc, doc,
`http-server`, `http-server`,
okhttp okhttp,
echo
) )
.settings(commonSettings) .settings(commonSettings)
.settings(noPublishSettings) .settings(noPublishSettings)

View File

@ -0,0 +1,5 @@
object Echo {
def main(args: Array[String]): Unit =
println(args.mkString(" "))
}