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

Informative failure for missing files mapped in universal #83

Merged
merged 2 commits into from
Nov 25, 2013
Merged
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 @@ -69,9 +69,14 @@ trait UniversalPlugin extends Plugin {
/** Creates packaging settings for a given package key, configuration + archive type. */
private[this] def makePackageSettings(packageKey: TaskKey[File], config: Configuration)(packager: Packager): Seq[Setting[_]] =
inConfig(config)(Seq(
mappings in packageKey <<= mappings,
mappings in packageKey <<= mappings map checkMappings,
packageKey <<= (target, name, mappings in packageKey) map packager
))

/** check that all mapped files actually exist */
private[this] def checkMappings(mappings: Seq[(File,String)]) : Seq[(File,String)] = {
mappings collect { case (f, p) => if(f.exists) (f, p) else sys.error("Mapped file " + f + " does not exist.") }
}

/** Finds all sources in a source directory. */
private[this] def findSources(sourceDir: File): Seq[(File, String)] =
Expand Down