From 8823df4fbc05c2a426f1eb5dd2c565ffce5689bc Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sat, 1 Jun 2013 10:56:30 -0400 Subject: [PATCH] additional docs on ModuleID.extra --- ivy/src/main/scala/sbt/ModuleID.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ivy/src/main/scala/sbt/ModuleID.scala b/ivy/src/main/scala/sbt/ModuleID.scala index df69274d4..e37c84da2 100644 --- a/ivy/src/main/scala/sbt/ModuleID.scala +++ b/ivy/src/main/scala/sbt/ModuleID.scala @@ -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)