Skip to content

Commit

Permalink
Merge pull request #207 from sbt/wip/fix-205
Browse files Browse the repository at this point in the history
Handle spaces in java arguments properly
  • Loading branch information
jsuereth committed Apr 1, 2014
2 parents 08e15fa + c132333 commit 92ddf6a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sbtVersion in Global := {
}
}

scalaVersion in Global := "2.9.2"
scalaVersion in Global := "2.10.2"

crossScalaVersions := Seq("2.9.2", "2.10.2")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ run() {
if [[ "$JAVA_OPTS" != "" ]]; then
java_opts="${JAVA_OPTS}"
fi

# run sbt
execRunner "$java_cmd" \
$(get_mem_opts $app_mem) \
${java_opts} \
${java_args[@]} \
${java_opts[@]} \
"${java_args[@]}" \
-cp "$(fix_classpath "$app_classpath")" \
$app_mainclass \
"${app_commands[@]}" \
Expand Down
3 changes: 3 additions & 0 deletions src/sbt-test/debian/java-app-archetype/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ TaskKey[Unit]("check-script") <<= (stagingDirectory in Universal, name, streams)
val output = Process("bash " + script.getAbsolutePath).!!
val expected = "SUCCESS!"
assert(output contains expected, "Failed to correctly run the main script!. Found ["+output+"] wanted ["+expected+"]")
val expected2 = "Something with spaces"
val output2 = Process(Seq("bash", script.getAbsolutePath, "-Dresult.string="+expected2)).!!
assert(output2 contains expected2, "Failed to correctly run the main script with spaced java args!. Found ["+output2+"] wanted ["+expected2+"]")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package test

object Test extends App {
println("SUCCESS!")
Option(sys.props("result.string")) match {
case Some(value) => println(value)
case _ => println("SUCCESS!")
}

}
2 changes: 1 addition & 1 deletion test-project/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.0
sbt.version=0.13.1
1 change: 0 additions & 1 deletion test-project/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.3")

0 comments on commit 92ddf6a

Please sign in to comment.