-
Notifications
You must be signed in to change notification settings - Fork 444
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 #172 from sbt/wip/packageMapping-tests
Wip/package mapping tests
- Loading branch information
Showing
16 changed files
with
115 additions
and
0 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
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( | ||
(baseDirectory.value / "src" / "resources" / "conf") -> "/usr/share/conf" | ||
) |
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")) |
12 changes: 12 additions & 0 deletions
12
src/sbt-test/debian/test-mapping-helpers/src/debian/changelog
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,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 |
6 changes: 6 additions & 0 deletions
6
src/sbt-test/debian/test-mapping-helpers/src/linux/usr/share/man/man1/test.1
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,6 @@ | ||
.\" Process this file with | ||
.\" groff -man -Tascii sbt.1 | ||
.\" | ||
.TH TEST 1 "NOVEMBER 2013" Linux "User Manuals" | ||
.SH NAME | ||
test \- TEST |
Empty file.
Empty file.
Empty file.
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,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 |
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,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, streams) map { (zipFile, streams) => | ||
val args = Seq(zipFile.getAbsolutePath) | ||
Process("unzip", args) ! streams.log | ||
} |
1 change: 1 addition & 0 deletions
1
src/sbt-test/universal/test-mapping-helpers/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 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
Empty file.
1 change: 1 addition & 0 deletions
1
src/sbt-test/universal/test-mapping-helpers/src/main/resources/docs/README
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 @@ | ||
README content |
Empty file.
Empty file.
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,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 |