mirror of https://github.com/sbt/sbt.git
Add start-year for compliance in ProjectInfo
This commit is contained in:
parent
fd130fcb16
commit
7f9adf31b8
|
|
@ -39,7 +39,7 @@ object ModuleID
|
||||||
if(key.startsWith("e:")) (key, value) else ("e:" + key, value)
|
if(key.startsWith("e:")) (key, value) else ("e:" + key, value)
|
||||||
}
|
}
|
||||||
/** Additional information about a project module */
|
/** Additional information about a project module */
|
||||||
case class ModuleInfo(nameFormal: String, description: String = "", homepage: Option[URL] = None, licenses: Seq[(String, URL)] = Nil, organizationName: String = "", organizationHomepage: Option[URL] = None)
|
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)
|
||||||
{
|
{
|
||||||
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)
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ class MakePom
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
{ makeModuleID(module) }
|
{ makeModuleID(module) }
|
||||||
<name>{moduleInfo.nameFormal}</name>
|
<name>{moduleInfo.nameFormal}</name>
|
||||||
|
{ makeStartYear(moduleInfo) }
|
||||||
{ makeOrganization(moduleInfo) }
|
{ makeOrganization(moduleInfo) }
|
||||||
{ extra }
|
{ extra }
|
||||||
{ makeProperties(module) }
|
{ makeProperties(module) }
|
||||||
|
|
@ -64,6 +65,8 @@ class MakePom
|
||||||
licenses(module.getLicenses)) : NodeSeq )
|
licenses(module.getLicenses)) : NodeSeq )
|
||||||
a ++ b
|
a ++ b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def makeStartYear(moduleInfo: ModuleInfo): NodeSeq = moduleInfo.startYear map { y => <inceptionYear>{y}</inceptionYear> } getOrElse NodeSeq.Empty
|
||||||
def makeOrganization(moduleInfo: ModuleInfo): NodeSeq =
|
def makeOrganization(moduleInfo: ModuleInfo): NodeSeq =
|
||||||
{
|
{
|
||||||
<organization>
|
<organization>
|
||||||
|
|
|
||||||
|
|
@ -624,11 +624,12 @@ object Classpaths
|
||||||
normalizedName <<= name(StringUtilities.normalize),
|
normalizedName <<= name(StringUtilities.normalize),
|
||||||
description <<= description or name.identity,
|
description <<= description or name.identity,
|
||||||
homepage in GlobalScope :== None,
|
homepage in GlobalScope :== None,
|
||||||
|
startYear in GlobalScope :== None,
|
||||||
licenses in GlobalScope :== Nil,
|
licenses in GlobalScope :== Nil,
|
||||||
organization <<= organization or normalizedName.identity,
|
organization <<= organization or normalizedName.identity,
|
||||||
organizationName <<= organizationName or organization.identity,
|
organizationName <<= organizationName or organization.identity,
|
||||||
organizationHomepage <<= organizationHomepage or homepage.identity,
|
organizationHomepage <<= organizationHomepage or homepage.identity,
|
||||||
projectInfo <<= (name, description, homepage, licenses, organizationName, organizationHomepage) apply ModuleInfo,
|
projectInfo <<= (name, description, homepage, startYear, licenses, organizationName, organizationHomepage) apply ModuleInfo,
|
||||||
classpathFilter in GlobalScope :== "*.jar" | "*.so" | "*.dll",
|
classpathFilter in GlobalScope :== "*.jar" | "*.so" | "*.dll",
|
||||||
externalResolvers <<= (externalResolvers.task.?, resolvers) {
|
externalResolvers <<= (externalResolvers.task.?, resolvers) {
|
||||||
case (Some(delegated), Seq()) => delegated
|
case (Some(delegated), Seq()) => delegated
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ object Keys
|
||||||
val normalizedName = SettingKey[String]("normalized-name", "Project name transformed from mixed case and spaces to lowercase and dash-separated.")
|
val normalizedName = SettingKey[String]("normalized-name", "Project name transformed from mixed case and spaces to lowercase and dash-separated.")
|
||||||
val description = SettingKey[String]("description", "Project description.")
|
val description = SettingKey[String]("description", "Project description.")
|
||||||
val homepage = SettingKey[Option[URL]]("homepage", "Project homepage.")
|
val homepage = SettingKey[Option[URL]]("homepage", "Project homepage.")
|
||||||
|
val startYear = SettingKey[Option[Int]]("start-year", "Year in which the project started.")
|
||||||
val licenses = SettingKey[Seq[(String, URL)]]("licenses", "Project licenses as (name, url) pairs.")
|
val licenses = SettingKey[Seq[(String, URL)]]("licenses", "Project licenses as (name, url) pairs.")
|
||||||
val organization = SettingKey[String]("organization", "Organization/group ID.")
|
val organization = SettingKey[String]("organization", "Organization/group ID.")
|
||||||
val organizationName = SettingKey[String]("organization-name", "Organization full/formal name.")
|
val organizationName = SettingKey[String]("organization-name", "Organization full/formal name.")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue