mirror of https://github.com/sbt/sbt.git
Merge pull request #7148 from armanbilge/feature/release-notes-url
Add `releaseNotesURL` setting
This commit is contained in:
commit
4a470dcd17
|
|
@ -200,6 +200,7 @@ object Defaults extends BuildCommon {
|
||||||
autoCompilerPlugins :== true,
|
autoCompilerPlugins :== true,
|
||||||
scalaHome :== None,
|
scalaHome :== None,
|
||||||
apiURL := None,
|
apiURL := None,
|
||||||
|
releaseNotesURL := None,
|
||||||
javaHome :== None,
|
javaHome :== None,
|
||||||
discoveredJavaHomes := CrossJava.discoverJavaHomes,
|
discoveredJavaHomes := CrossJava.discoverJavaHomes,
|
||||||
javaHomes :== ListMap.empty,
|
javaHomes :== ListMap.empty,
|
||||||
|
|
@ -3388,7 +3389,12 @@ object Classpaths {
|
||||||
p1.extra(SbtPomExtraProperties.VERSION_SCHEME_KEY -> x)
|
p1.extra(SbtPomExtraProperties.VERSION_SCHEME_KEY -> x)
|
||||||
case _ => p1
|
case _ => p1
|
||||||
}
|
}
|
||||||
p2
|
val p3 = releaseNotesURL.value match {
|
||||||
|
case Some(u) =>
|
||||||
|
p2.extra(SbtPomExtraProperties.POM_RELEASE_NOTES_KEY -> u.toExternalForm)
|
||||||
|
case _ => p2
|
||||||
|
}
|
||||||
|
p3
|
||||||
}
|
}
|
||||||
def pluginProjectID: Initialize[ModuleID] =
|
def pluginProjectID: Initialize[ModuleID] =
|
||||||
Def.setting {
|
Def.setting {
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,7 @@ object Keys {
|
||||||
val entryApiURL = AttributeKey[URL]("entryApiURL", "Base URL for the API documentation for a classpath entry.")
|
val entryApiURL = AttributeKey[URL]("entryApiURL", "Base URL for the API documentation for a classpath entry.")
|
||||||
val apiMappings = taskKey[Map[File, URL]]("Mappings from classpath entry to API documentation base URL.").withRank(BMinusSetting)
|
val apiMappings = taskKey[Map[File, URL]]("Mappings from classpath entry to API documentation base URL.").withRank(BMinusSetting)
|
||||||
val autoAPIMappings = settingKey[Boolean]("If true, automatically manages mappings to the API doc URL.").withRank(BMinusSetting)
|
val autoAPIMappings = settingKey[Boolean]("If true, automatically manages mappings to the API doc URL.").withRank(BMinusSetting)
|
||||||
|
val releaseNotesURL = settingKey[Option[URL]]("URL for release notes.").withRank(BMinusSetting)
|
||||||
val scmInfo = settingKey[Option[ScmInfo]]("Basic SCM information for the project.").withRank(BMinusSetting)
|
val scmInfo = settingKey[Option[ScmInfo]]("Basic SCM information for the project.").withRank(BMinusSetting)
|
||||||
val projectInfo = settingKey[ModuleInfo]("Addition project information like formal name, homepage, licenses etc.").withRank(CSetting)
|
val projectInfo = settingKey[ModuleInfo]("Addition project information like formal name, homepage, licenses etc.").withRank(CSetting)
|
||||||
val defaultConfiguration = settingKey[Option[Configuration]]("Defines the configuration used when none is specified for a dependency in ivyXML.").withRank(CSetting)
|
val defaultConfiguration = settingKey[Option[Configuration]]("Defines the configuration used when none is specified for a dependency in ivyXML.").withRank(CSetting)
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ object CoursierInputsTasks {
|
||||||
sv: String,
|
sv: String,
|
||||||
sbv: String,
|
sbv: String,
|
||||||
auOpt: Option[URL],
|
auOpt: Option[URL],
|
||||||
|
rnOpt: Option[URL],
|
||||||
description: String,
|
description: String,
|
||||||
homepage: Option[URL],
|
homepage: Option[URL],
|
||||||
vsOpt: Option[String],
|
vsOpt: Option[String],
|
||||||
|
|
@ -70,8 +71,15 @@ object CoursierInputsTasks {
|
||||||
proj1.withProperties(proj1.properties :+ (SbtPomExtraProperties.VERSION_SCHEME_KEY -> vs))
|
proj1.withProperties(proj1.properties :+ (SbtPomExtraProperties.VERSION_SCHEME_KEY -> vs))
|
||||||
case _ => proj1
|
case _ => proj1
|
||||||
}
|
}
|
||||||
proj2.withInfo(
|
val proj3 = rnOpt match {
|
||||||
proj2.info.withDescription(description).withHomePage(homepage.fold("")(_.toString))
|
case Some(rn) =>
|
||||||
|
proj2.withProperties(
|
||||||
|
proj2.properties :+ (SbtPomExtraProperties.POM_RELEASE_NOTES_KEY -> rn.toString)
|
||||||
|
)
|
||||||
|
case _ => proj2
|
||||||
|
}
|
||||||
|
proj3.withInfo(
|
||||||
|
proj3.info.withDescription(description).withHomePage(homepage.fold("")(_.toString))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,6 +92,7 @@ object CoursierInputsTasks {
|
||||||
scalaVersion.value,
|
scalaVersion.value,
|
||||||
scalaBinaryVersion.value,
|
scalaBinaryVersion.value,
|
||||||
apiURL.value,
|
apiURL.value,
|
||||||
|
releaseNotesURL.value,
|
||||||
description.value,
|
description.value,
|
||||||
homepage.value,
|
homepage.value,
|
||||||
versionScheme.value,
|
versionScheme.value,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,11 @@ lazy val root = (project in file(".")) settings (
|
||||||
TaskKey[Unit]("checkPom") := checkPom.value,
|
TaskKey[Unit]("checkPom") := checkPom.value,
|
||||||
TaskKey[Unit]("checkExtra") := checkExtra.value,
|
TaskKey[Unit]("checkExtra") := checkExtra.value,
|
||||||
TaskKey[Unit]("checkVersionPlusMapping") := checkVersionPlusMapping.value,
|
TaskKey[Unit]("checkVersionPlusMapping") := checkVersionPlusMapping.value,
|
||||||
|
TaskKey[Unit]("checkAPIURL") := checkAPIURL.value,
|
||||||
|
TaskKey[Unit]("checkReleaseNotesURL") := checkReleaseNotesURL.value,
|
||||||
resolvers += Resolver.sonatypeRepo("snapshots"),
|
resolvers += Resolver.sonatypeRepo("snapshots"),
|
||||||
|
apiURL := Some(url("https://www.scala-sbt.org/1.x/api/")),
|
||||||
|
releaseNotesURL := Some(url("https://github.com/sbt/sbt/releases")),
|
||||||
makePomConfiguration := {
|
makePomConfiguration := {
|
||||||
val p = makePomConfiguration.value
|
val p = makePomConfiguration.value
|
||||||
p.withExtra(<extra-tag/>)
|
p.withExtra(<extra-tag/>)
|
||||||
|
|
@ -46,6 +50,16 @@ lazy val checkVersionPlusMapping = (readPom) map { (pomXml) =>
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lazy val checkAPIURL = (readPom) map { (pomXml) =>
|
||||||
|
val notes = pomXml \ "properties" \ "info.apiURL"
|
||||||
|
if (notes.isEmpty) sys.error("'apiURL' not found in generated pom.xml.") else ()
|
||||||
|
}
|
||||||
|
|
||||||
|
lazy val checkReleaseNotesURL = (readPom) map { (pomXml) =>
|
||||||
|
val notes = pomXml \ "properties" \ "info.releaseNotesUrl"
|
||||||
|
if (notes.isEmpty) sys.error("'releaseNotesUrl' not found in generated pom.xml.") else ()
|
||||||
|
}
|
||||||
|
|
||||||
lazy val checkPom = Def task {
|
lazy val checkPom = Def task {
|
||||||
val pomXML = readPom.value
|
val pomXML = readPom.value
|
||||||
checkProject(pomXML)
|
checkProject(pomXML)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
> checkPom
|
> checkPom
|
||||||
> checkExtra
|
> checkExtra
|
||||||
> checkVersionPlusMapping
|
> checkVersionPlusMapping
|
||||||
|
> checkAPIURL
|
||||||
|
> checkReleaseNotesURL
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue