-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wip/package mapping tests #172
Changes from 4 commits
2f5d346
6e83cf6
d3e0d2c
2302170
4a9708b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import NativePackagerKeys._ | ||
import NativePackagerHelper._ | ||
|
||
packagerSettings | ||
|
||
mapGenericFilesToLinux | ||
|
||
name := "debian-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <[email protected]>" | ||
|
||
packageSummary := "Test debian package" | ||
|
||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
|
||
// linuxPackageMappings in Debian += packageTemplateMapping("/var/run/debian") // not work | ||
// linuxPackageMappings in Debian += packageTemplateMapping("/var/run/debian")() // not work | ||
linuxPackageMappings in Debian += packageTemplateMapping(Seq("/opt/test/other"):_*)() | ||
|
||
linuxPackageMappings in Debian <+= (Keys.normalizedName, target) map { (name, tmp) => | ||
packageTemplateMapping("/opt/test/" + name)(tmp) | ||
} | ||
|
||
// Consider using mappings in Universal | ||
linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( | ||
file("src/resources/conf") -> "/usr/share/conf" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
sbt (0.12.0-build-0100) | ||
|
||
* No need for different launcher jar files now | ||
|
||
-- Joshua Suereth <[email protected]> 2012-07-2012 | ||
|
||
sbt (0.11.2-build-0100) | ||
|
||
* First debian package release | ||
|
||
-- Joshua Suereth <[email protected]> 2011-11-29 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.\" Process this file with | ||
.\" groff -man -Tascii sbt.1 | ||
.\" | ||
.TH TEST 1 "NOVEMBER 2013" Linux "User Manuals" | ||
.SH NAME | ||
test \- TEST |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Run the debian packaging. | ||
> debian:package-bin | ||
$ exists target/debian-test-0.1.0.deb | ||
|
||
# Template directories | ||
$ exists target/debian-test-0.1.0/opt/test/debian-test | ||
$ exists target/debian-test-0.1.0/opt/test/other | ||
|
||
# Directories with content | ||
$ exists target/debian-test-0.1.0/usr/share/conf | ||
$ exists target/debian-test-0.1.0/usr/share/conf/application.conf | ||
$ exists target/debian-test-0.1.0/usr/share/conf/log4j.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import NativePackagerKeys._ | ||
import com.typesafe.sbt.packager.MappingsHelper._ | ||
|
||
packagerSettings | ||
|
||
packagerSettings | ||
|
||
name := "simple-test" | ||
|
||
version := "0.1.0" | ||
|
||
// or just place your cache folder in /src/universal/ | ||
mappings in Universal ++= directory("src/main/resources/cache") | ||
|
||
// or just place your cache folder in /src/universal/ | ||
mappings in Universal ++= contentOf("src/main/resources/docs") | ||
|
||
mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map { (_, src) => | ||
// we are using the reference.conf as default application.conf | ||
// the user can override settings here | ||
val conf = src / "main" / "resources" / "reference.conf" | ||
conf -> "conf/application.conf" | ||
} | ||
|
||
TaskKey[Unit]("unzip") <<= (packageBin in Universal) map { (zipFile) => | ||
val args = Seq(zipFile.getAbsolutePath) | ||
Process("unzip", args) ! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should always have the . here if you're using postfix or add the logs argument:
I realize sometimes I'm lazy here :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh! I saw that one time and was a bit confused at first, but the get it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DOH, that should be |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README content |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Run the universal packaging. | ||
> universal:package-bin | ||
$ exists target/universal/simple-test-0.1.0.zip | ||
|
||
> unzip | ||
$ exists simple-test-0.1.0/ | ||
|
||
# Mapped by convention | ||
$ exists simple-test-0.1.0/conf/ | ||
$ exists simple-test-0.1.0/conf/log4j.properties | ||
|
||
# Mapped with directory() | ||
$ exists simple-test-0.1.0/cache/ | ||
$ exists simple-test-0.1.0/cache/cache.conf | ||
|
||
# Mapped with contentOf() | ||
$ exists simple-test-0.1.0/ | ||
$ exists simple-test-0.1.0/README | ||
|
||
# Mapped with task | ||
$ exists simple-test-0.1.0/conf/application.conf | ||
$ absent simple-test-0.1.0/conf/reference.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note, you should always do this relative to a directory, like
(baseDirectory.value / "src/resources/conf") -> "/usr/share/conf"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'll change this