mirror of https://github.com/sbt/sbt.git
commit
c1fd09e6bf
|
|
@ -10,7 +10,9 @@ import org.apache.ivy.plugins.resolver.{ DependencyResolver, IBiblioResolver }
|
||||||
import org.apache.ivy.util.url.CredentialsStore
|
import org.apache.ivy.util.url.CredentialsStore
|
||||||
|
|
||||||
/** Additional information about a project module */
|
/** 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 formally(name: String) = copy(nameFormal = name)
|
||||||
def describing(desc: String, home: Option[URL]) = copy(description = desc, homepage = home)
|
def describing(desc: String, home: Option[URL]) = copy(description = desc, homepage = home)
|
||||||
def licensed(lics: (String, URL)*) = copy(licenses = lics)
|
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 */
|
/** Basic SCM information for a project module */
|
||||||
final case class ScmInfo(browseUrl: URL, connection: String, devConnection: Option[String] = None)
|
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. */
|
/** 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)
|
final case class ExclusionRule(organization: String = "*", name: String = "*", artifact: String = "*", configurations: Seq[String] = Nil)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ class MakePom(val log: Logger) {
|
||||||
{ makeStartYear(moduleInfo) }
|
{ makeStartYear(moduleInfo) }
|
||||||
{ makeOrganization(moduleInfo) }
|
{ makeOrganization(moduleInfo) }
|
||||||
{ makeScmInfo(moduleInfo) }
|
{ makeScmInfo(moduleInfo) }
|
||||||
|
{ makeDeveloperInfo(moduleInfo) }
|
||||||
{ extra }
|
{ extra }
|
||||||
{
|
{
|
||||||
val deps = depsInConfs(module, configurations)
|
val deps = depsInConfs(module, configurations)
|
||||||
|
|
@ -100,6 +101,21 @@ class MakePom(val log: Logger) {
|
||||||
case _ => NodeSeq.Empty
|
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 =
|
def makeProperties(module: ModuleDescriptor, dependencies: Seq[DependencyDescriptor]): NodeSeq =
|
||||||
{
|
{
|
||||||
val extra = IvySbt.getExtraAttributes(module)
|
val extra = IvySbt.getExtraAttributes(module)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue