-
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.
Support for absolute paths in classpath (#882)
* Support for absolute paths when adding to classpath Do not prefix with $lib_dir when an absolute path is added to the classpath * Add absolute path support in Windows * Test case for absolute path support * add comment * bat filename should match project name * Explicit check for path len
- Loading branch information
Showing
15 changed files
with
82 additions
and
3 deletions.
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
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,15 @@ | ||
enablePlugins(JavaAppPackaging) | ||
|
||
name := "absolute-path-in-bash" | ||
|
||
version := "0.1.0" | ||
|
||
scriptClasspath in bashScriptDefines ++= Seq("/dummy/absolute/path", "relative/path") | ||
|
||
TaskKey[Unit]("run-check") := { | ||
val dir = (stagingDirectory in Universal).value | ||
|
||
val bash = IO.read(dir / "bin" / "absolute-path-in-bash") | ||
assert(bash contains ":/dummy/absolute/path") | ||
assert(bash contains ":$lib_dir/relative/path") | ||
} |
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/bash/absolute-path-in-bash/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("SUCCESS!") | ||
} |
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 @@ | ||
# Run the staging and check the script. | ||
> stage | ||
> run-check |
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,21 @@ | ||
enablePlugins(JavaAppPackaging) | ||
|
||
name := "absolute-path" | ||
|
||
version := "0.1.0" | ||
|
||
scriptClasspath in bashScriptDefines ++= Seq("/dummy/absolute/path", "relative/path") | ||
|
||
scriptClasspath in batScriptReplacements ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") | ||
|
||
TaskKey[Unit]("run-check") := { | ||
val dir = (stagingDirectory in Universal).value | ||
|
||
val bash = IO.read(dir / "bin" / "absolute-path") | ||
assert(bash contains ":/dummy/absolute/path") | ||
assert(bash contains ":$lib_dir/relative/path") | ||
|
||
val bat = IO.read(dir / "bin" / "absolute-path.bat") | ||
assert(bat contains ";x:\\dummy\\absolute\\path") | ||
assert(bat contains "%APP_LIB_DIR%\\relative\\path") | ||
} |
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/universal/absolute-path/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("SUCCESS!") | ||
} |
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 @@ | ||
# Run the staging and check the script. | ||
> stage | ||
> run-check |
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,15 @@ | ||
enablePlugins(JavaAppPackaging) | ||
|
||
name := "absolute-path-in-bat" | ||
|
||
version := "0.1.0" | ||
|
||
scriptClasspath in batScriptReplacements ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") | ||
|
||
TaskKey[Unit]("run-check") := { | ||
val dir = (stagingDirectory in Universal).value | ||
|
||
val bat = IO.read(dir / "bin" / "absolute-path-in-bat.bat") | ||
assert(bat contains ";x:\\dummy\\absolute\\path") | ||
assert(bat contains "%APP_LIB_DIR%\\relative\\path") | ||
} |
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/windows/absolute-path-in-bat/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("SUCCESS!") | ||
} |
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 @@ | ||
# Run the staging and check the script. | ||
> stage | ||
> run-check |