我很新的SBT,需要为我的项目的一个创建RPM软件包。 的RPM只包含1个文件,其是由SBT-onejar插件创建一个onejar)。 我想用SBT-本机打包插件,并创造了这样的/项目目录下的文件Packagin.scala:
object Packaging {
val settings: Seq[Setting[_]] = packagerSettings ++ deploymentSettings ++ mapGenericFilesToLinux ++ Seq(
maintainer := "Team",
packageSummary := "Summary",
packageDescription := """Description""",
mappings in Universal += {
file("target/scala-2.10/projectname_2.10-0.1-one-jar.jar") -> "/opt/projectname/projectname-0.1.jar"
},
linuxPackageMappings in Rpm <+= (baseDirectory) map { _:File =>
(packageMapping(file("target/scala-2.10/projectname_2.10-0.1-one-jar.jar") -> "/opt/projectname/projectname-0.1.jar")
withUser "someusr" withGroup "somegroup" withPerms "0755")
},
name in Rpm := "projectname",
version in Rpm <<= version apply { sv => sv split "[^\\d]" filterNot (_.isEmpty) mkString "." },
rpmRelease := "1",
rpmVendor := "Vendor",
rpmUrl := Some("url"),
rpmGroup := Some("group"),
rpmLicense := Some("BSD")
)
}
1)我不想硬编码的文件名。 相反,具有"target/scala-2.10/projectname_2.10-0.1-one-jar.jar"
我需要一种方式来利用现有SettingKey的,即target + "scala-" + scalaVersion + "/" + name + "_" + scalaVersion + "-" + version + "-one-jar.jar"
-你怎么做到这一点=
2)对于值rpmRelease := "1"
我想用一个系统属性,即在Maven的我会做${rpm.buildNumber}
,如何做在SBT的工作?
3)有什么我应该做的问候更好地SBT-本机打包插件?