Skip to content
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

Prefer normalizedName for linux-friendly packages, rather than requiring... #41

Merged
merged 1 commit into from
Sep 23, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ trait GenericPackageSettings

def mapGenericFilesToLinux: Seq[Setting[_]] = Seq(
// First we look at the src/linux files
linuxPackageMappings <++= (name in Universal, sourceDirectory in Linux) map { (pkg, dir) =>
linuxPackageMappings <++= (sourceDirectory in Linux) map { dir =>
mapGenericMappingsToLinux((dir.*** --- dir) x relativeTo(dir))(identity)
},
// Now we look at the src/universal files.
linuxPackageMappings <++= (name in Universal, mappings in Universal) map { (pkg, mappings) =>
linuxPackageMappings <++= (normalizedName in Universal, mappings in Universal) map { (pkg, mappings) =>
// TODO - More windows filters...
def isWindowsFile(f: (File, String)): Boolean =
f._2 endsWith ".bat"
Expand All @@ -77,7 +77,7 @@ trait GenericPackageSettings
}
},
// Now we generate symlinks.
linuxPackageSymlinks <++= (name in Universal, mappings in Universal) map { (pkg, mappings) =>
linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal) map { (pkg, mappings) =>
for {
(file, name) <- mappings
if !file.isDirectory
Expand All @@ -86,7 +86,7 @@ trait GenericPackageSettings
} yield LinuxSymlink("/usr/" + name, installLocation+"/"+pkg+"/"+name)
},
// Map configuration files
linuxPackageSymlinks <++= (name in Universal, mappings in Universal) map { (pkg, mappings) =>
linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal) map { (pkg, mappings) =>
val needsConfLink =
mappings exists { case (file, name) =>
(name startsWith "conf/") && !file.isDirectory
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/com/typesafe/sbt/packager/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ object Keys extends linux.Keys
with universal.UniversalKeys {

// TODO - Do these keys belong here?
def normalizedName = sbt.Keys.normalizedName

// These keys are used by the JavaApp archetype.
val makeBashScript = TaskKey[Option[File]]("makeBashScript", "Creates or discovers the bash script used by this project.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ object Keys extends UniversalKeys {
def packageSrc = sbt.Keys.packageSrc
def packageDoc = sbt.Keys.packageDoc
def name = sbt.Keys.name
def normalizedName = sbt.Keys.normalizedName
def target = sbt.Keys.target
def sourceDirectory = sbt.Keys.sourceDirectory
def streams = sbt.Keys.streams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait UniversalPlugin extends Plugin {
dist <<= dist in Universal,
stage <<= stage in Universal,
// TODO - New default to naming, is this right?
name in Universal <<= (name, version) apply (_ + "-" + _)
name in Universal <<= (normalizedName, version) apply (_ + "-" + _)
) ++
makePackageSettingsForConfig(Universal) ++
makePackageSettingsForConfig(UniversalDocs) ++
Expand Down