-
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.
Merge pull request #566 from metasim/metasim/fix-563
Additional tests and fix for #563.
- Loading branch information
Showing
7 changed files
with
42 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# Run the jdkpackager packaging | ||
> jdkPackager:packageBin | ||
> checkImage | ||
|
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,16 @@ | ||
// Tests plugin behavior when none of the metadata keys are set. | ||
|
||
enablePlugins(JDKPackagerPlugin) | ||
|
||
mainClass in Compile := Some("ExampleApp") | ||
|
||
TaskKey[Unit]("checkImage") <<= (target in JDKPackager, name, streams) map { (base, name, streams) ⇒ | ||
val extension = sys.props("os.name").toLowerCase match { | ||
case os if os.contains("mac") ⇒ ".app" | ||
case os if os.contains("win") ⇒ ".exe" | ||
case _ ⇒ "" | ||
} | ||
val expectedImage = base / "bundles" / (name + extension) | ||
println(s"Checking for '${expectedImage.getAbsolutePath}'") | ||
assert(expectedImage.exists, s"Expected image file to be found at '$expectedImage'") | ||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/jdkpackager/test-package-minimal/project/plugins.sbt
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,9 @@ | ||
{ | ||
val pluginVersion = sys.props("project.version") | ||
if (pluginVersion == null) | ||
throw new RuntimeException( | ||
"""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) | ||
} |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/jdkpackager/test-package-minimal/src/main/scala/test/Test.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,5 @@ | ||
package test | ||
|
||
object Test 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 jdkpackager packaging | ||
> jdkPackager:packageBin | ||
> checkImage |