additional docs on ModuleID.extra

This commit is contained in:
Mark Harrah 2013-06-01 10:56:30 -04:00
parent 271b03550b
commit 8823df4fbc
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,8 @@ final case class ModuleID(organization: String, name: String, revision: String,
/** Excludes the dependency with organization `org` and `name` from being introduced by this dependency during resolution. */
def exclude(org: String, name: String) = excludeAll(ExclusionRule(org, name))
/** Adds extra attributes for this module. All keys are prefixed with `e:` if they are not already so prefixed.
* This information will only be published in an ivy.xml and not in a pom.xml. */
def extra(attributes: (String,String)*) = copy(extraAttributes = this.extraAttributes ++ ModuleID.checkE(attributes))
/** Not recommended for new use. This method is not deprecated, but the `update-classifiers` task is preferred
@ -96,6 +98,7 @@ final case class ModuleID(organization: String, name: String, revision: String,
}
object ModuleID
{
/** Prefixes all keys with `e:` if they are not already so prefixed. */
def checkE(attributes: Seq[(String, String)]) =
for ( (key, value) <- attributes) yield
if(key.startsWith("e:")) (key, value) else ("e:" + key, value)