diff --git a/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala b/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala index 484d77a85..85de0eb90 100644 --- a/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala @@ -3,10 +3,9 @@ package com.typesafe.sbt import packager._ import debian.Keys.genChanges -import Keys.packageZipTarball -import Keys.packageXzTarball +import Keys.{ packageName, packageZipTarball, packageXzTarball } import sbt._ -import sbt.Keys.packageBin +import sbt.Keys.{ normalizedName, packageBin } object SbtNativePackager extends Plugin with linux.LinuxPlugin @@ -30,7 +29,8 @@ object SbtNativePackager extends Plugin Seq( // Bad defaults that let us at least not explode users who don't care about native packagers NativePackagerKeys.maintainer := "", NativePackagerKeys.packageDescription := "", - NativePackagerKeys.packageSummary := "" + NativePackagerKeys.packageSummary := "", + packageName <<= normalizedName ) import SettingsHelper._ diff --git a/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala b/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala index 58086a691..b65f9778d 100644 --- a/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala +++ b/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala @@ -66,7 +66,7 @@ trait GenericPackageSettings mapGenericMappingsToLinux(MappingsHelper contentOf dir, Users.Root, Users.Root)(identity) }, // Now we look at the src/universal files. - linuxPackageMappings <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation) map { + linuxPackageMappings <++= (packageName in Linux, mappings in Universal, defaultLinuxInstallLocation) map { (pkg, mappings, installLocation) => // TODO - More windows filters... def isWindowsFile(f: (File, String)): Boolean = @@ -77,7 +77,7 @@ trait GenericPackageSettings } }, // Now we generate symlinks. - linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation) map { (pkg, mappings, installLocation) => + linuxPackageSymlinks <++= (packageName in Linux, mappings in Universal, defaultLinuxInstallLocation) map { (pkg, mappings, installLocation) => for { (file, name) <- mappings if !file.isDirectory @@ -86,7 +86,7 @@ trait GenericPackageSettings } yield LinuxSymlink("/usr/" + name, installLocation + "/" + pkg + "/" + name) }, // Map configuration files - linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation, defaultLinuxConfigLocation) + linuxPackageSymlinks <++= (packageName in Linux, mappings in Universal, defaultLinuxInstallLocation, defaultLinuxConfigLocation) map { (pkg, mappings, installLocation, configLocation) => val needsConfLink = mappings exists { diff --git a/src/main/scala/com/typesafe/sbt/packager/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/Keys.scala index e342db4a8..2bec3bc06 100644 --- a/src/main/scala/com/typesafe/sbt/packager/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/Keys.scala @@ -11,6 +11,7 @@ object Keys extends linux.Keys with universal.UniversalKeys { // These keys are used by the JavaApp/JavaServer archetypes. + val packageName = SettingKey[String]("packageName", "Name of the created output package. Used for dirs/scripts.") val makeBashScript = TaskKey[Option[File]]("makeBashScript", "Creates or discovers the bash script used by this project.") val bashScriptDefines = TaskKey[Seq[String]]("bashScriptDefines", "A list of definitions that should be written to the bash file template.") val bashScriptExtraDefines = TaskKey[Seq[String]]("bashScriptExtraDefines", "A list of extra definitions that should be written to the bash file template.") @@ -27,8 +28,11 @@ object Keys extends linux.Keys | APP_NAME - the name of the app | APP_DEFINES - the defines to go into the app | """.stripMargin) + + // TODO put these into the linux plugin val defaultLinuxInstallLocation = SettingKey[String]("defaultLinuxInstallLocation", "The location where we will install generic linux packages.") val defaultLinuxLogsLocation = SettingKey[String]("defaultLinuxLogsLocation", "The location where application logs will be stored.") val defaultLinuxConfigLocation = SettingKey[String]("defaultLinuxConfigLocation", "The location where application config files will be stored") val defaultLinuxStartScriptLocation = SettingKey[String]("defaultLinuxStartScriptLocation", "The location where start script for server application will be stored") + } diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaApp.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaApp.scala index 91778f6e4..753fbbc35 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaApp.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaApp.scala @@ -45,7 +45,7 @@ object JavaAppPackaging { hasMain getOrElse Nil }, // TODO - Overridable bash template. - makeBashScript <<= (bashScriptDefines, target in Universal, normalizedName, sourceDirectory) map makeUniversalBinScript, + makeBashScript <<= (bashScriptDefines, target in Universal, packageName, sourceDirectory) map makeUniversalBinScript, batScriptExtraDefines := Nil, batScriptReplacements <<= (normalizedName, Keys.mainClass in Compile, scriptClasspath, batScriptExtraDefines) map { (name, mainClass, cp, extras) => mainClass map { mc => @@ -53,18 +53,18 @@ object JavaAppPackaging { } getOrElse Nil }, - makeBatScript <<= (batScriptReplacements, target in Universal, normalizedName, sourceDirectory) map makeUniversalBatScript, - mappings in Universal <++= (makeBashScript, normalizedName) map { (script, name) => + makeBatScript <<= (batScriptReplacements, target in Universal, packageName, sourceDirectory) map makeUniversalBatScript, + mappings in Universal <++= (makeBashScript, packageName) map { (script, name) => for { s <- script.toSeq } yield s -> ("bin/" + name) }, - mappings in Universal <++= (makeBatScript, normalizedName) map { (script, name) => + mappings in Universal <++= (makeBatScript, packageName) map { (script, name) => for { s <- script.toSeq } yield s -> ("bin/" + name + ".bat") }, - linuxPackageMappings in Debian <+= (normalizedName, defaultLinuxInstallLocation, target in Debian) map { + linuxPackageMappings in Debian <+= (packageName in Debian, defaultLinuxInstallLocation, target in Debian) map { (name, installLocation, target) => // create empty var/log directory val d = target / installLocation diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala index 37d9d7eb4..0035e92fc 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala @@ -4,7 +4,7 @@ package archetypes import Keys._ import sbt._ -import sbt.Keys.{ target, mainClass, normalizedName, sourceDirectory, streams } +import sbt.Keys.{ target, mainClass, sourceDirectory, streams } import SbtNativePackager._ import com.typesafe.sbt.packager.linux.{ LinuxFileMetaData, LinuxPackageMapping, LinuxSymlink, LinuxPlugin } import com.typesafe.sbt.packager.debian.DebianPlugin @@ -89,53 +89,53 @@ object JavaServerAppPackaging { */ def linuxSettings: Seq[Setting[_]] = Seq( // === logging directory mapping === - linuxPackageMappings <+= (normalizedName, defaultLinuxLogsLocation, daemonUser in Linux, daemonGroup in Linux) map { + linuxPackageMappings <+= (packageName in Linux, defaultLinuxLogsLocation, daemonUser in Linux, daemonGroup in Linux) map { (name, logsDir, user, group) => packageTemplateMapping(logsDir + "/" + name)() withUser user withGroup group withPerms "755" }, - linuxPackageSymlinks <+= (normalizedName, defaultLinuxInstallLocation, defaultLinuxLogsLocation) map { + linuxPackageSymlinks <+= (packageName in Linux, defaultLinuxInstallLocation, defaultLinuxLogsLocation) map { (name, install, logsDir) => LinuxSymlink(install + "/" + name + "/logs", logsDir + "/" + name) }, // === etc config mapping === - bashScriptConfigLocation <<= normalizedName map (name => Some("/etc/default/" + name)), + bashScriptConfigLocation <<= (packageName in Linux) map (name => Some("/etc/default/" + name)), linuxEtcDefaultTemplate <<= sourceDirectory map { dir => val overrideScript = dir / "templates" / "etc-default" if (overrideScript.exists) overrideScript.toURI.toURL else etcDefaultTemplateSource }, - makeEtcDefault <<= (normalizedName, target in Universal, linuxEtcDefaultTemplate, linuxScriptReplacements) + makeEtcDefault <<= (packageName in Linux, target in Universal, linuxEtcDefaultTemplate, linuxScriptReplacements) map makeEtcDefaultScript, - linuxPackageMappings <++= (makeEtcDefault, normalizedName) map { (conf, name) => + linuxPackageMappings <++= (makeEtcDefault, packageName in Linux) map { (conf, name) => conf.map(c => LinuxPackageMapping(Seq(c -> ("/etc/default/" + name)), LinuxFileMetaData(Users.Root, Users.Root)).withConfig()).toSeq }, // === /var/run/app pid folder === - linuxPackageMappings <+= (normalizedName, daemonUser in Linux, daemonGroup in Linux) map { (name, user, group) => + linuxPackageMappings <+= (packageName in Linux, daemonUser in Linux, daemonGroup in Linux) map { (name, user, group) => packageTemplateMapping("/var/run/" + name)() withUser user withGroup group withPerms "755" }) def debianSettings: Seq[Setting[_]] = { import DebianPlugin.Names.{ Preinst, Postinst, Prerm, Postrm } - Seq( - serverLoading in Debian := Upstart, - startRunlevels in Debian <<= (serverLoading in Debian) apply defaultStartRunlevels, - stopRunlevels in Debian <<= (serverLoading in Debian) apply defaultStopRunlevels, - requiredStartFacilities in Debian <<= (serverLoading in Debian) apply defaultFacilities, - requiredStopFacilities in Debian <<= (serverLoading in Debian) apply defaultFacilities, - linuxJavaAppStartScriptBuilder in Debian := JavaAppStartScript.Debian, + inConfig(Debian)(Seq( + serverLoading := Upstart, + startRunlevels <<= (serverLoading) apply defaultStartRunlevels, + stopRunlevels <<= (serverLoading) apply defaultStopRunlevels, + requiredStartFacilities <<= (serverLoading) apply defaultFacilities, + requiredStopFacilities <<= (serverLoading) apply defaultFacilities, + linuxJavaAppStartScriptBuilder := JavaAppStartScript.Debian, // === Startscript creation === - linuxScriptReplacements in Debian <++= (requiredStartFacilities in Debian, requiredStopFacilities in Debian, startRunlevels in Debian, stopRunlevels in Debian, serverLoading in Debian) apply + linuxScriptReplacements <++= (requiredStartFacilities, requiredStopFacilities, startRunlevels, stopRunlevels, serverLoading) apply makeStartScriptReplacements, - linuxStartScriptTemplate in Debian <<= (serverLoading in Debian, sourceDirectory, linuxJavaAppStartScriptBuilder in Debian) map { + linuxStartScriptTemplate <<= (serverLoading, sourceDirectory, linuxJavaAppStartScriptBuilder) map { (loader, dir, builder) => builder.defaultStartScriptTemplate(loader, dir / "templates" / "start") }, - defaultLinuxStartScriptLocation in Debian <<= (serverLoading in Debian) apply getStartScriptLocation, - linuxMakeStartScript in Debian <<= (target in Universal, serverLoading in Debian, linuxScriptReplacements in Debian, linuxStartScriptTemplate in Debian, linuxJavaAppStartScriptBuilder in Debian) + defaultLinuxStartScriptLocation <<= (serverLoading) apply getStartScriptLocation, + linuxMakeStartScript <<= (target in Universal, serverLoading, linuxScriptReplacements, linuxStartScriptTemplate, linuxJavaAppStartScriptBuilder) map { (tmpDir, loader, replacements, template, builder) => makeMaintainerScript(builder.startScript, Some(template))(tmpDir, loader, replacements, builder) }, - linuxPackageMappings in Debian <++= (normalizedName, linuxMakeStartScript in Debian, serverLoading in Debian, defaultLinuxStartScriptLocation in Debian) map startScriptMapping, - + linuxPackageMappings <++= (packageName, linuxMakeStartScript, serverLoading, defaultLinuxStartScriptLocation) map startScriptMapping + )) ++ Seq( // === Maintainer scripts === debianMakePreinstScript <<= (target in Universal, serverLoading in Debian, linuxScriptReplacements, linuxJavaAppStartScriptBuilder in Debian) map makeMaintainerScript(Preinst), debianMakePostinstScript <<= (target in Universal, serverLoading in Debian, linuxScriptReplacements, linuxJavaAppStartScriptBuilder in Debian) map makeMaintainerScript(Postinst), @@ -145,15 +145,16 @@ object JavaServerAppPackaging { def rpmSettings: Seq[Setting[_]] = { import RpmPlugin.Names.{ Pre, Post, Preun, Postun } - Seq( - serverLoading in Rpm := SystemV, - startRunlevels in Rpm <<= (serverLoading in Rpm) apply defaultStartRunlevels, - stopRunlevels in Rpm <<= (serverLoading in Rpm) apply defaultStopRunlevels, - requiredStartFacilities in Rpm <<= (serverLoading in Rpm) apply defaultFacilities, - requiredStopFacilities in Rpm <<= (serverLoading in Rpm) apply defaultFacilities, - linuxJavaAppStartScriptBuilder in Rpm := JavaAppStartScript.Rpm, - linuxScriptReplacements in Rpm <++= (requiredStartFacilities in Rpm, requiredStopFacilities in Rpm, startRunlevels in Rpm, stopRunlevels in Rpm, serverLoading in Rpm) apply - makeStartScriptReplacements, + inConfig(Rpm)(Seq( + serverLoading := SystemV, + startRunlevels <<= (serverLoading) apply defaultStartRunlevels, + stopRunlevels in Rpm <<= (serverLoading) apply defaultStopRunlevels, + requiredStartFacilities in Rpm <<= (serverLoading) apply defaultFacilities, + requiredStopFacilities in Rpm <<= (serverLoading) apply defaultFacilities, + linuxJavaAppStartScriptBuilder := JavaAppStartScript.Rpm, + linuxScriptReplacements <++= (requiredStartFacilities, requiredStopFacilities, startRunlevels, stopRunlevels, serverLoading) apply + makeStartScriptReplacements + )) ++ Seq( // === Startscript creation === linuxStartScriptTemplate in Rpm <<= (serverLoading in Rpm, sourceDirectory, linuxJavaAppStartScriptBuilder in Rpm) map { (loader, dir, builder) => @@ -164,7 +165,7 @@ object JavaServerAppPackaging { makeMaintainerScript(builder.startScript, Some(template))(tmpDir, loader, replacements, builder) }, defaultLinuxStartScriptLocation in Rpm <<= (serverLoading in Rpm) apply getStartScriptLocation, - linuxPackageMappings in Rpm <++= (normalizedName, linuxMakeStartScript in Rpm, serverLoading in Rpm, defaultLinuxStartScriptLocation in Rpm) map startScriptMapping, + linuxPackageMappings in Rpm <++= (packageName in Rpm, linuxMakeStartScript in Rpm, serverLoading in Rpm, defaultLinuxStartScriptLocation in Rpm) map startScriptMapping, // == Maintainer scripts === // TODO this is very basic - align debian and rpm plugin diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala index 0d96a7ac0..ed877b851 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala @@ -27,6 +27,7 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin with NativePackaging wi debianSignRole := "builder", target in Debian <<= (target, name in Debian, version in Debian) apply ((t, n, v) => t / (n + "-" + v)), name in Debian <<= (name in Linux), + packageName in Debian <<= (packageName in Linux), version in Debian <<= (version in Linux), linuxPackageMappings in Debian <<= linuxPackageMappings, packageDescription in Debian <<= packageDescription in Linux, @@ -46,15 +47,15 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin with NativePackaging wi debianMaintainerScripts <++= (debianMakePrermScript, debianControlScriptsDirectory) map scriptMapping(Names.Prerm), debianMaintainerScripts <++= (debianMakePreinstScript, debianControlScriptsDirectory) map scriptMapping(Names.Preinst), debianMaintainerScripts <++= (debianMakePostinstScript, debianControlScriptsDirectory) map scriptMapping(Names.Postinst), - debianMaintainerScripts <++= (debianMakePostrmScript, debianControlScriptsDirectory) map scriptMapping(Names.Postrm)) ++ inConfig(Debian)( - /* ==== Debian scoped settings ==== */ + debianMaintainerScripts <++= (debianMakePostrmScript, debianControlScriptsDirectory) map scriptMapping(Names.Postrm)) ++ + /* ==== Debian scoped settings ==== */ + inConfig(Debian)( Seq( packageArchitecture := "all", debianPackageInfo <<= - (normalizedName, version, maintainer, packageSummary, packageDescription) apply PackageInfo, + (packageName, version, maintainer, packageSummary, packageDescription) apply PackageInfo, debianPackageMetadata <<= - (debianPackageInfo, - debianPriority, packageArchitecture, debianSection, + (debianPackageInfo, debianPriority, packageArchitecture, debianSection, debianPackageDependencies, debianPackageRecommends) apply PackageMetaData, debianPackageInstallSize <<= linuxPackageMappings map { mappings => (for { diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/debian/Keys.scala index b6b9ebce3..85ce654d1 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/Keys.scala @@ -47,6 +47,7 @@ trait DebianKeys { object Keys extends DebianKeys { // Metadata keys def name = sbt.Keys.name + def packageName = linux.Keys.packageName def version = sbt.Keys.version def maintainer = linux.Keys.maintainer def packageArchitecture = linux.Keys.packageArchitecture diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/NativePackaging.scala b/src/main/scala/com/typesafe/sbt/packager/debian/NativePackaging.scala index 6db378a87..9e03392ab 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/NativePackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/NativePackaging.scala @@ -4,7 +4,7 @@ package debian import Keys._ import sbt._ -import sbt.Keys.{ target, name, normalizedName, TaskStreams } +import sbt.Keys.{ target, name, TaskStreams } import linux.{ LinuxFileMetaData, LinuxPackageMapping, LinuxSymlink } import linux.Keys.{ linuxScriptReplacements, daemonShell } import com.typesafe.sbt.packager.Hashing diff --git a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala index c86be0bfd..51502bfb6 100644 --- a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala @@ -49,8 +49,8 @@ trait DockerPlugin extends Plugin with UniversalPlugin { } private[this] final def generateDockerConfig( - dockerBaseImage: String, dockerBaseDirectory: String, maintainer: String, daemonUser: String, normalizedName: String, exposedPorts: Seq[Int], exposedVolumes: Seq[String], target: File) = { - val dockerContent = makeDockerContent(dockerBaseImage, dockerBaseDirectory, maintainer, daemonUser, normalizedName, exposedPorts, exposedVolumes) + dockerBaseImage: String, dockerBaseDirectory: String, maintainer: String, daemonUser: String, packageName: String, exposedPorts: Seq[Int], exposedVolumes: Seq[String], target: File) = { + val dockerContent = makeDockerContent(dockerBaseImage, dockerBaseDirectory, maintainer, daemonUser, packageName, exposedPorts, exposedVolumes) val f = target / "Dockerfile" IO.write(f, dockerContent) @@ -149,9 +149,16 @@ trait DockerPlugin extends Plugin with UniversalPlugin { def dockerSettings: Seq[Setting[_]] = Seq( dockerBaseImage := "dockerfile/java", name in Docker <<= name, + packageName in Docker <<= packageName, dockerRepository := None, sourceDirectory in Docker <<= sourceDirectory apply (_ / "docker"), - target in Docker <<= target apply (_ / "docker") + target in Docker <<= target apply (_ / "docker"), + + // TODO this must be changed, when there is a setting for the startScripts name + dockerGenerateConfig <<= + (dockerBaseImage in Docker, defaultLinuxInstallLocation in Docker, maintainer in Docker, daemonUser in Docker, + packageName /* this is not scoped!*/ , dockerExposedPorts in Docker, dockerExposedVolumes in Docker, target in Docker) map + generateDockerConfig ) ++ mapGenericFilesToDocker ++ inConfig(Docker)(Seq( daemonUser := "daemon", defaultLinuxInstallLocation := "/opt/docker", @@ -161,7 +168,6 @@ trait DockerPlugin extends Plugin with UniversalPlugin { MappingsHelper contentOf dir }, mappings <++= dockerPackageMappings, - normalizedName <<= name apply StringUtilities.normalize, stage <<= (dockerGenerateConfig, dockerGenerateContext) map { (configFile, contextDir) => () }, dockerGenerateContext <<= (cacheDirectory, mappings, target) map { (cacheDirectory, mappings, t) => @@ -169,7 +175,7 @@ trait DockerPlugin extends Plugin with UniversalPlugin { stageFiles("docker")(cacheDirectory, contextDir, mappings) contextDir }, - dockerTarget <<= (dockerRepository, normalizedName, version) map { + dockerTarget <<= (dockerRepository, packageName, version) map { (repo, name, version) => repo.map(_ + "/").getOrElse("") + name + ":" + version }, @@ -180,11 +186,6 @@ trait DockerPlugin extends Plugin with UniversalPlugin { publish <<= (publishLocal, dockerTarget, streams) map { (_, target, s) => publishDocker(target, s.log) - }, - dockerGenerateConfig <<= - (dockerBaseImage, defaultLinuxInstallLocation, maintainer, daemonUser, normalizedName, dockerExposedPorts, dockerExposedVolumes, target) map { - case (dockerBaseImage, baseDirectory, maintainer, daemonUser, normalizedName, exposedPorts, exposedVolumes, target) => - generateDockerConfig(dockerBaseImage, baseDirectory, maintainer, daemonUser, normalizedName, exposedPorts, exposedVolumes, target) - } + } )) } diff --git a/src/main/scala/com/typesafe/sbt/packager/docker/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/docker/Keys.scala index a12f01c76..5dde299bb 100644 --- a/src/main/scala/com/typesafe/sbt/packager/docker/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/docker/Keys.scala @@ -20,6 +20,9 @@ object Keys extends DockerKeys { def cacheDirectory = sbt.Keys.cacheDirectory def mappings = sbt.Keys.mappings def name = sbt.Keys.name + def packageName = universal.Keys.packageName + def normalizedName = universal.Keys.normalizedName + def stage = universal.Keys.stage def publish = sbt.Keys.publish def publishArtifact = sbt.Keys.publishArtifact def publishLocal = sbt.Keys.publishLocal @@ -28,8 +31,6 @@ object Keys extends DockerKeys { def target = sbt.Keys.target def version = sbt.Keys.version def defaultLinuxInstallLocation = packager.Keys.defaultLinuxInstallLocation - def normalizedName = universal.Keys.normalizedName - def stage = universal.Keys.stage def daemonUser = linux.Keys.daemonUser def maintainer = linux.Keys.maintainer } diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/linux/Keys.scala index 2cb395631..8ce055e62 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/Keys.scala @@ -47,5 +47,8 @@ trait Keys { } object Keys extends Keys { + def name = sbt.Keys.name + def packageName = packager.Keys.packageName + def normalizedName = sbt.Keys.normalizedName def sourceDirectory = sbt.Keys.sourceDirectory } \ No newline at end of file diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala index 1a10fd52f..d9d3a1379 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala @@ -34,7 +34,10 @@ trait LinuxPlugin extends Plugin { }, packageSummary in Linux <<= packageSummary, packageDescription in Linux <<= packageDescription, - daemonUser in Linux <<= normalizedName, + name in Linux <<= name, + packageName in Linux <<= packageName, + normalizedName in Linux <<= (name in Linux) apply Project.normalizeModuleID, + daemonUser in Linux <<= normalizedName in Linux, daemonGroup in Linux <<= daemonUser in Linux, daemonShell in Linux := "/bin/false", defaultLinuxInstallLocation := "/usr/share", @@ -44,7 +47,7 @@ trait LinuxPlugin extends Plugin { linuxJavaAppStartScriptBuilder := JavaAppStartScript.Debian, // This one is begging for sbt 0.13 syntax... linuxScriptReplacements <<= ( - maintainer in Linux, packageSummary in Linux, daemonUser in Linux, daemonGroup in Linux, daemonShell in Linux, normalizedName, + maintainer in Linux, packageSummary in Linux, daemonUser in Linux, daemonGroup in Linux, daemonShell in Linux, normalizedName in Linux, sbt.Keys.version, defaultLinuxInstallLocation, linuxJavaAppStartScriptBuilder) apply { (author, descr, daemonUser, daemonGroup, daemonShell, name, version, installLocation, builder) => val appDir = installLocation + "/" + name diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala index c90294cb0..193055ff8 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala @@ -61,6 +61,8 @@ trait RpmKeys { object Keys extends RpmKeys { // METADATA keys. def name = sbt.Keys.name + def packageName = packager.Keys.packageName + def normalizedName = sbt.Keys.normalizedName def version = sbt.Keys.version def maintainer = linux.Keys.maintainer def packageArchitecture = linux.Keys.packageArchitecture diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala index 3767f74b7..02b90c7e3 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala @@ -2,10 +2,10 @@ package com.typesafe.sbt package packager package rpm -import Keys._ -import linux._ import sbt._ import sbt.Keys.sourceDirectory +import rpm.Keys._ +import linux._ import java.nio.charset.Charset /** Plugin trait containing all generic values used for packaging linux software. */ @@ -41,13 +41,17 @@ trait RpmPlugin extends Plugin with LinuxPlugin { rpmPostun := None, rpmBrpJavaRepackJars := false, rpmScriptsDirectory <<= sourceDirectory apply (_ / "rpm" / Names.Scriptlets), + // Explicitly defer default settings to generic Linux Settings. packageSummary in Rpm <<= packageSummary in Linux, packageDescription in Rpm <<= packageDescription in Linux, - target in Rpm <<= target(_ / "rpm") + target in Rpm <<= target(_ / "rpm"), + name in Rpm <<= name in Linux, + packageName in Rpm <<= packageName in Linux ) ++ inConfig(Rpm)(Seq( + normalizedName <<= name apply Project.normalizeModuleID, packageArchitecture := "noarch", rpmMetadata <<= - (name, version, rpmRelease, rpmPrefix, packageArchitecture, rpmVendor, rpmOs, packageSummary, packageDescription, rpmAutoprov, rpmAutoreq) apply RpmMetadata, + (packageName, version, rpmRelease, rpmPrefix, packageArchitecture, rpmVendor, rpmOs, packageSummary, packageDescription, rpmAutoprov, rpmAutoreq) apply RpmMetadata, rpmDescription <<= (rpmLicense, rpmDistribution, rpmUrl, rpmGroup, rpmPackager, rpmIcon) apply RpmDescription, rpmDependencies <<= diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/universal/Keys.scala index 8e74cdd97..62cea4fe8 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/Keys.scala @@ -19,6 +19,7 @@ object Keys extends UniversalKeys { def packageSrc = sbt.Keys.packageSrc def packageDoc = sbt.Keys.packageDoc def name = sbt.Keys.name + def packageName = packager.Keys.packageName def normalizedName = sbt.Keys.normalizedName def target = sbt.Keys.target def sourceDirectory = sbt.Keys.sourceDirectory diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala index a8deab515..e43f2740a 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala @@ -21,7 +21,11 @@ trait UniversalPlugin extends Plugin { dist <<= dist in Universal, stage <<= stage in Universal, // TODO - New default to naming, is this right? - name in Universal <<= (normalizedName, version) apply (_ + "-" + _) + // TODO - We may need to do this for UniversalSrcs + UnviersalDocs + name in Universal <<= name, + name in UniversalDocs <<= name in Universal, + name in UniversalSrc <<= name in Universal, + packageName in Universal <<= packageName ) ++ makePackageSettingsForConfig(Universal) ++ makePackageSettingsForConfig(UniversalDocs) ++ @@ -34,6 +38,8 @@ trait UniversalPlugin extends Plugin { makePackageSettings(packageZipTarball, config)(makeTgz) ++ makePackageSettings(packageXzTarball, config)(makeTxz) ++ inConfig(config)(Seq( + normalizedName <<= name apply Project.normalizeModuleID, + packageName <<= (packageName, version) apply (_ + "-" + _), mappings <<= sourceDirectory map findSources, dist <<= (packageBin, streams) map printDist, stagingDirectory <<= target apply (_ / "stage"), @@ -74,7 +80,7 @@ trait UniversalPlugin extends Plugin { private[this] def makePackageSettings(packageKey: TaskKey[File], config: Configuration)(packager: Packager): Seq[Setting[_]] = inConfig(config)(Seq( mappings in packageKey <<= mappings map checkMappings, - packageKey <<= (target, name, mappings in packageKey) map packager + packageKey <<= (target, packageName, mappings in packageKey) map packager )) /** check that all mapped files actually exist */ diff --git a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala index 44521bb11..48eb0f288 100644 --- a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala @@ -11,6 +11,7 @@ trait WindowsPlugin extends Plugin { def windowsSettings: Seq[Setting[_]] = Seq( sourceDirectory in Windows <<= sourceDirectory(_ / "windows"), target in Windows <<= target apply (_ / "windows"), + // TODO - Should this use normalized name like the linux guys? name in Windows <<= name, // Defaults so that our simplified building works candleOptions := Seq("-ext", "WixUtilExtension"), diff --git a/src/sbt-test/debian/test-mapping/build.sbt b/src/sbt-test/debian/test-mapping/build.sbt index a856482cd..67ab0c4df 100644 --- a/src/sbt-test/debian/test-mapping/build.sbt +++ b/src/sbt-test/debian/test-mapping/build.sbt @@ -6,6 +6,10 @@ mapGenericFilesToLinux name := "debian-test" +name in Debian := "debian-test-override" + +packageName in Linux := "debian-test-package" + version := "0.1.0" maintainer := "Josh Suereth " @@ -18,3 +22,11 @@ packageDescription := """A fun package description of our software, debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") debianPackageRecommends in Debian += "git" + +TaskKey[Unit]("check-control-script") <<= (target, streams) map { (target, out) => + val script = IO.read(target / "debian-test-override-0.1.0" / "DEBIAN" / "control") + assert(script.contains("Package: debian-test-package\n"), "script doesn't [Package: debian-test-package]\n" + script) + assert(script.contains("Source: debian-test-package\n"), "script doesn't [Source: debian-test-package]\n" + script) + out.log.success("Successfully tested control script") + () +} diff --git a/src/sbt-test/debian/test-mapping/test b/src/sbt-test/debian/test-mapping/test index 26bce309f..c1c8150bd 100644 --- a/src/sbt-test/debian/test-mapping/test +++ b/src/sbt-test/debian/test-mapping/test @@ -1,6 +1,12 @@ # Run the debian packaging. > debian:package-bin -$ exists target/debian-test_0.1.0_all.deb - - +$ exists target/debian-test-override_0.1.0_all.deb +# Testing the packageName configuration +$ exists target/debian-test-override-0.1.0/DEBIAN +$ exists target/debian-test-override-0.1.0/DEBIAN/control +> check-control-script +$ exists target/debian-test-override-0.1.0/usr/ +$ exists target/debian-test-override-0.1.0/usr/share/ +$ exists target/debian-test-override-0.1.0/usr/share/debian-test-package/ +# Testing control script # TODO - Test that the generic mapping did the right thing. diff --git a/src/sbt-test/debian/test-packageName/build.sbt b/src/sbt-test/debian/test-packageName/build.sbt new file mode 100644 index 000000000..8c85d3f35 --- /dev/null +++ b/src/sbt-test/debian/test-packageName/build.sbt @@ -0,0 +1,32 @@ +import NativePackagerKeys._ + +packagerSettings + +packageArchetype.java_server + +name := "debian-test" + +name in Debian := "debian-test-override" + +packageName in Linux := "debian-test-package" + +version := "0.1.0" + +maintainer := "Josh Suereth " + +packageSummary := "Test debian package" + +packageDescription := """A fun package description of our software, + with multiple lines.""" + +debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") + +debianPackageRecommends in Debian += "git" + +TaskKey[Unit]("check-control-script") <<= (target, streams) map { (target, out) => + val script = IO.read(target / "debian-test-override-0.1.0" / "DEBIAN" / "control") + assert(script.contains("Package: debian-test-package\n"), "script doesn't [Package: debian-test-package]\n" + script) + assert(script.contains("Source: debian-test-package\n"), "script doesn't [Source: debian-test-package]\n" + script) + out.log.success("Successfully tested control script") + () +} diff --git a/src/sbt-test/debian/test-packageName/project/plugins.sbt b/src/sbt-test/debian/test-packageName/project/plugins.sbt new file mode 100644 index 000000000..b53de154c --- /dev/null +++ b/src/sbt-test/debian/test-packageName/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/debian/test-packageName/src/debian/changelog b/src/sbt-test/debian/test-packageName/src/debian/changelog new file mode 100644 index 000000000..ec30582fa --- /dev/null +++ b/src/sbt-test/debian/test-packageName/src/debian/changelog @@ -0,0 +1,12 @@ + +sbt (0.12.0-build-0100) + + * No need for different launcher jar files now + + -- Joshua Suereth 2012-07-2012 + +sbt (0.11.2-build-0100) + + * First debian package release + + -- Joshua Suereth 2011-11-29 diff --git a/src/sbt-test/debian/test-packageName/test b/src/sbt-test/debian/test-packageName/test new file mode 100644 index 000000000..c76ae0c97 --- /dev/null +++ b/src/sbt-test/debian/test-packageName/test @@ -0,0 +1,15 @@ +# Run the debian packaging. +> debian:package-bin +$ exists target/debian-test-override_0.1.0_all.deb +# Testing the packageName configuration +$ exists target/debian-test-override-0.1.0/DEBIAN +$ exists target/debian-test-override-0.1.0/DEBIAN/control +> check-control-script +$ exists target/debian-test-override-0.1.0/usr/ +$ exists target/debian-test-override-0.1.0/usr/share/ +$ exists target/debian-test-override-0.1.0/usr/share/debian-test-package/ +$ exists target/debian-test-override-0.1.0/var/log/debian-test-package/ +$ exists target/debian-test-override-0.1.0/var/run/debian-test-package/ +$ exists target/debian-test-override-0.1.0/etc/default/debian-test-package/ +# Testing control script +# TODO - Test that the generic mapping did the right thing. diff --git a/src/sbt-test/debian/upstart-deb/build.sbt b/src/sbt-test/debian/upstart-deb/build.sbt index c1c85c94c..f87d2666d 100644 --- a/src/sbt-test/debian/upstart-deb/build.sbt +++ b/src/sbt-test/debian/upstart-deb/build.sbt @@ -11,6 +11,8 @@ mainClass in Compile := Some("empty") name := "debian-test" +name in Debian := "debian-test" + version := "0.1.0" maintainer := "Josh Suereth " diff --git a/src/sbt-test/docker/test-packageName-universal/build.sbt b/src/sbt-test/docker/test-packageName-universal/build.sbt new file mode 100644 index 000000000..fa360f39e --- /dev/null +++ b/src/sbt-test/docker/test-packageName-universal/build.sbt @@ -0,0 +1,19 @@ +import com.typesafe.sbt.SbtNativePackager._ +import NativePackagerKeys._ + +packageArchetype.java_application + +name := "docker-test" + +packageName := "docker-package" // sets the executable script, too + +version := "0.1.0" + +maintainer := "Gary Coady " + +TaskKey[Unit]("check-dockerfile") <<= (target, streams) map { (target, out) => + val dockerfile = IO.read(target / "docker" / "Dockerfile") + assert(dockerfile.contains("ENTRYPOINT [\"bin/docker-package\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"docker-package\"]\n" + dockerfile) + out.log.success("Successfully tested control script") + () +} \ No newline at end of file diff --git a/src/sbt-test/docker/test-packageName-universal/project/plugins.sbt b/src/sbt-test/docker/test-packageName-universal/project/plugins.sbt new file mode 100644 index 000000000..b53de154c --- /dev/null +++ b/src/sbt-test/docker/test-packageName-universal/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/docker/test-packageName-universal/src/main/scala/Main.scala b/src/sbt-test/docker/test-packageName-universal/src/main/scala/Main.scala new file mode 100644 index 000000000..61471c658 --- /dev/null +++ b/src/sbt-test/docker/test-packageName-universal/src/main/scala/Main.scala @@ -0,0 +1,3 @@ +object Main extends App { + println("Hello world") +} diff --git a/src/sbt-test/docker/test-packageName-universal/test b/src/sbt-test/docker/test-packageName-universal/test new file mode 100644 index 000000000..c1208e7f4 --- /dev/null +++ b/src/sbt-test/docker/test-packageName-universal/test @@ -0,0 +1,6 @@ +# Generate the Docker image locally +> docker:publishLocal +$ exists target/docker/Dockerfile +$ exists target/docker/files/opt/docker/bin/docker-package +> check-dockerfile +$ exec bash -c 'docker run docker-package:0.1.0 | grep -q "Hello world"' \ No newline at end of file diff --git a/src/sbt-test/docker/test-packageName/build.sbt b/src/sbt-test/docker/test-packageName/build.sbt new file mode 100644 index 000000000..5592141fd --- /dev/null +++ b/src/sbt-test/docker/test-packageName/build.sbt @@ -0,0 +1,20 @@ +import com.typesafe.sbt.SbtNativePackager._ +import NativePackagerKeys._ + +packageArchetype.java_application + +name := "docker-test" + +// packageName := "docker-package" // sets the executable script, too +packageName in Docker := "docker-package" + +version := "0.1.0" + +maintainer := "Gary Coady " + +TaskKey[Unit]("check-dockerfile") <<= (target, streams) map { (target, out) => + val dockerfile = IO.read(target / "docker" / "Dockerfile") + assert(dockerfile.contains("ENTRYPOINT [\"bin/docker-test\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"docker-test\"]\n" + dockerfile) + out.log.success("Successfully tested control script") + () +} diff --git a/src/sbt-test/docker/test-packageName/project/plugins.sbt b/src/sbt-test/docker/test-packageName/project/plugins.sbt new file mode 100644 index 000000000..b53de154c --- /dev/null +++ b/src/sbt-test/docker/test-packageName/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/docker/test-packageName/src/main/scala/Main.scala b/src/sbt-test/docker/test-packageName/src/main/scala/Main.scala new file mode 100644 index 000000000..61471c658 --- /dev/null +++ b/src/sbt-test/docker/test-packageName/src/main/scala/Main.scala @@ -0,0 +1,3 @@ +object Main extends App { + println("Hello world") +} diff --git a/src/sbt-test/docker/test-packageName/test b/src/sbt-test/docker/test-packageName/test new file mode 100644 index 000000000..857cfe0ac --- /dev/null +++ b/src/sbt-test/docker/test-packageName/test @@ -0,0 +1,6 @@ +# Generate the Docker image locally +> docker:publishLocal +$ exists target/docker/Dockerfile +$ exists target/docker/files/opt/docker/bin/docker-test +> check-dockerfile +$ exec bash -c 'docker run docker-package:0.1.0 | grep -q "Hello world"' \ No newline at end of file diff --git a/src/sbt-test/rpm/test-packageName/build.sbt b/src/sbt-test/rpm/test-packageName/build.sbt new file mode 100644 index 000000000..f943712da --- /dev/null +++ b/src/sbt-test/rpm/test-packageName/build.sbt @@ -0,0 +1,38 @@ +import NativePackagerKeys._ + +packageArchetype.java_server + +name := "rpm-test" + +version := "0.1.0" + +maintainer := "Josh Suereth " + +packageSummary := "Test rpm package" + +packageName in Linux := "rpm-package" + +packageDescription := """A fun package description of our software, + with multiple lines.""" + +rpmRelease := "1" + +rpmVendor := "typesafe" + +rpmUrl := Some("http://github.com/sbt/sbt-native-packager") + +rpmLicense := Some("BSD") + +TaskKey[Unit]("check-spec-file") <<= (target, streams) map { (target, out) => + val spec = IO.read(target / "rpm" / "SPECS" / "rpm-package.spec") + out.log.success(spec) + assert(spec contains "%attr(0644,root,root) /usr/share/rpm-package/lib/rpm-test.rpm-test-0.1.0.jar", "Wrong installation path\n" + spec) + assert(spec contains "%config %attr(0755,root,root) /etc/init.d/rpm-package", "Wrong etc path path\n" + spec) + assert(spec contains "%config %attr(755,root,root) /etc/default/rpm-package", "Wrong etc default file\n" + spec) + assert(spec contains "%config %attr(0755,root,root) /etc/init.d/rpm-package", "Wrong etc path\n" + spec) + assert(spec contains "%dir %attr(755,rpm-test,rpm-test) /var/log/rpm-package", "Wrong logging dir path\n" + spec) + assert(spec contains "%dir %attr(755,rpm-test,rpm-test) /var/run/rpm-package", "Wrong /var/run dir path\n" + spec) + out.log.success("Successfully tested rpm test file") + () +} + diff --git a/src/sbt-test/rpm/test-packageName/project/plugins.sbt b/src/sbt-test/rpm/test-packageName/project/plugins.sbt new file mode 100644 index 000000000..b53de154c --- /dev/null +++ b/src/sbt-test/rpm/test-packageName/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/rpm/test-packageName/test b/src/sbt-test/rpm/test-packageName/test new file mode 100644 index 000000000..a4f4caa85 --- /dev/null +++ b/src/sbt-test/rpm/test-packageName/test @@ -0,0 +1,7 @@ +# Run the debian packaging. +> rpm:package-bin +$ exists target/rpm/RPMS/noarch/rpm-package-0.1.0-1.noarch.rpm +$ exists target/rpm/SPECS/rpm-package.spec + +# Check files for defaults +> check-spec-file diff --git a/src/sbt-test/universal/test-mapping-helpers/test b/src/sbt-test/universal/test-mapping-helpers/test index 8d919da8a..f6cfad758 100644 --- a/src/sbt-test/universal/test-mapping-helpers/test +++ b/src/sbt-test/universal/test-mapping-helpers/test @@ -1,5 +1,5 @@ # Run the universal packaging. -> universal:package-bin +> show universal:package-bin $ exists target/universal/simple-test-0.1.0.zip > unzip diff --git a/src/sbt-test/universal/test-packageName/build.sbt b/src/sbt-test/universal/test-packageName/build.sbt new file mode 100644 index 000000000..d49aa28d7 --- /dev/null +++ b/src/sbt-test/universal/test-packageName/build.sbt @@ -0,0 +1,9 @@ +import NativePackagerKeys._ + +packageArchetype.java_application + +name := "simple-test" + +packageName in Universal := "simple-package" + +version := "0.1.0" diff --git a/src/sbt-test/universal/test-packageName/project/plugins.sbt b/src/sbt-test/universal/test-packageName/project/plugins.sbt new file mode 100644 index 000000000..b53de154c --- /dev/null +++ b/src/sbt-test/universal/test-packageName/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/universal/test-packageName/src/main/scala/Main.scala b/src/sbt-test/universal/test-packageName/src/main/scala/Main.scala new file mode 100644 index 000000000..61471c658 --- /dev/null +++ b/src/sbt-test/universal/test-packageName/src/main/scala/Main.scala @@ -0,0 +1,3 @@ +object Main extends App { + println("Hello world") +} diff --git a/src/sbt-test/universal/test-packageName/test b/src/sbt-test/universal/test-packageName/test new file mode 100644 index 000000000..27165bada --- /dev/null +++ b/src/sbt-test/universal/test-packageName/test @@ -0,0 +1,11 @@ +# Run the zip packaging. +> show universal:package-bin +$ exists target/universal/simple-package.zip + +# Run the tgz packaging. +> universal:package-zip-tarball +$ exists target/universal/simple-package.tgz + +# Run the txz packaging. +> universal:package-xz-tarball +$ exists target/universal/simple-package.txz \ No newline at end of file