mirror of https://github.com/sbt/sbt.git
commit
3c8893ef2c
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1009,6 +1009,7 @@ object Classpaths {
|
|||
homepage :== None,
|
||||
startYear :== None,
|
||||
licenses :== Nil,
|
||||
developers :== Nil,
|
||||
scmInfo :== None,
|
||||
offline :== false,
|
||||
defaultConfiguration :== Some(Configurations.Compile),
|
||||
|
|
@ -1042,7 +1043,7 @@ object Classpaths {
|
|||
organization <<= organization or normalizedName,
|
||||
organizationName <<= organizationName or organization,
|
||||
organizationHomepage <<= organizationHomepage or homepage,
|
||||
projectInfo <<= (name, description, homepage, startYear, licenses, organizationName, organizationHomepage, scmInfo) apply ModuleInfo,
|
||||
projectInfo <<= (name, description, homepage, startYear, licenses, organizationName, organizationHomepage, scmInfo, developers) apply ModuleInfo,
|
||||
overrideBuildResolvers <<= appConfiguration(isOverrideRepositories),
|
||||
externalResolvers <<= (externalResolvers.task.?, resolvers, appResolvers) {
|
||||
case (Some(delegated), Seq(), _) => delegated
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ object Keys {
|
|||
val organization = SettingKey[String]("organization", "Organization/group ID.", APlusSetting)
|
||||
val organizationName = SettingKey[String]("organization-name", "Organization full/formal name.", BMinusSetting)
|
||||
val organizationHomepage = SettingKey[Option[URL]]("organization-homepage", "Organization homepage.", BMinusSetting)
|
||||
val developers = SettingKey[List[Developer]]("developers", "List of developers implicated in the project", BMinusSetting)
|
||||
val apiURL = SettingKey[Option[URL]]("api-url", "Base URL for API documentation.", BMinusSetting)
|
||||
val entryApiURL = AttributeKey[URL]("entry-api-url", "Base URL for the API documentation for a classpath entry.")
|
||||
val apiMappings = TaskKey[Map[File, URL]]("api-mappings", "Mappings from classpath entry to API documentation base URL.", BMinusSetting)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
[1586]: https://github.com/sbt/sbt/pull/1586
|
||||
[1590]: Https://github.com/sbt/sbt/pull/1590
|
||||
[@jsuereth]: https://github.com/jsuereth
|
||||
|
||||
|
||||
### Improvements
|
||||
|
||||
* Add developers key
|
||||
|
||||
### Fixes with compatibility implications
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue