Merge pull request #1590 from jedesah/0.13

Add developer key
This commit is contained in:
Josh Suereth 2014-09-17 10:32:04 -04:00
commit c1fd09e6bf
2 changed files with 21 additions and 1 deletions

View File

@ -10,7 +10,9 @@ import org.apache.ivy.plugins.resolver.{ DependencyResolver, IBiblioResolver }
import org.apache.ivy.util.url.CredentialsStore
/** Additional information about a project module */
final case class ModuleInfo(nameFormal: String, description: String = "", homepage: Option[URL] = None, startYear: Option[Int] = None, licenses: Seq[(String, URL)] = Nil, organizationName: String = "", organizationHomepage: Option[URL] = None, scmInfo: Option[ScmInfo] = None) {
final case class ModuleInfo(nameFormal: String, description: String = "", homepage: Option[URL] = None, startYear: Option[Int] = None, licenses: Seq[(String, URL)] = Nil, organizationName: String = "", organizationHomepage: Option[URL] = None, scmInfo: Option[ScmInfo] = None, developers: Seq[Developer] = Seq()) {
def this(nameFormal: String, description: String, homepage: Option[URL], startYear: Option[Int], licenses: Seq[(String, URL)], organizationName: String, organizationHomepage: Option[URL], scmInfo: Option[ScmInfo]) =
this(nameFormal = nameFormal, description = description, homepage = homepage, startYear = startYear, licenses = licenses, organizationName = organizationName, organizationHomepage = organizationHomepage, scmInfo = scmInfo, developers = Seq())
def formally(name: String) = copy(nameFormal = name)
def describing(desc: String, home: Option[URL]) = copy(description = desc, homepage = home)
def licensed(lics: (String, URL)*) = copy(licenses = lics)
@ -20,6 +22,8 @@ final case class ModuleInfo(nameFormal: String, description: String = "", homepa
/** Basic SCM information for a project module */
final case class ScmInfo(browseUrl: URL, connection: String, devConnection: Option[String] = None)
final case class Developer(id: String, name: String, email: String, url: URL)
/** Rule to exclude unwanted dependencies pulled in transitively by a module. */
final case class ExclusionRule(organization: String = "*", name: String = "*", artifact: String = "*", configurations: Seq[String] = Nil)

View File

@ -42,6 +42,7 @@ class MakePom(val log: Logger) {
{ makeStartYear(moduleInfo) }
{ makeOrganization(moduleInfo) }
{ makeScmInfo(moduleInfo) }
{ makeDeveloperInfo(moduleInfo) }
{ extra }
{
val deps = depsInConfs(module, configurations)
@ -100,6 +101,21 @@ class MakePom(val log: Logger) {
case _ => NodeSeq.Empty
}
}
def makeDeveloperInfo(moduleInfo: ModuleInfo): NodeSeq =
{
if (moduleInfo.developers.nonEmpty) {
<developers>
moduleInfo.developers.map{ developer: Developer =>
<developer>
<id>{ developer.id }</id>
<name>{ developer.name }</name>
<email>{ developer.email }</email>
<url>{ developer.url }</url>
</developer>
}
</developers>
} else NodeSeq.Empty
}
def makeProperties(module: ModuleDescriptor, dependencies: Seq[DependencyDescriptor]): NodeSeq =
{
val extra = IvySbt.getExtraAttributes(module)