-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added command line JAVA_OPTS support for AshScriptPlugin (#1255)
- Loading branch information
Showing
6 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
enablePlugins(JavaAppPackaging, AshScriptPlugin) | ||
|
||
name := "command-line-app" | ||
|
||
version := "0.1.0-SNAPSHOT" | ||
|
||
TaskKey[Unit]("runCheck") := { | ||
val configArg = "-Dconfig.resource=/config.conf" | ||
val cwd = (stagingDirectory in Universal).value | ||
val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath, configArg) | ||
|
||
val output = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "") | ||
assert(output.contains(configArg), s"Application did not receive command line configuration resource $configArg") | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
3 changes: 3 additions & 0 deletions
3
src/sbt-test/ash/command-line-settings/src/main/scala/MainApp.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
object MainApp extends App { | ||
println(args.mkString("|")) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Run the staging and check the script. | ||
> stage | ||
$ exists target/universal/stage/bin/command-line-app | ||
> runCheck |