Add test for `apiURL`

This commit is contained in:
Arman Bilge 2023-02-28 18:08:29 +00:00
parent 1a2b2467b4
commit 414c3a4358
2 changed files with 8 additions and 0 deletions

View File

@ -5,8 +5,10 @@ lazy val root = (project in file(".")) settings (
TaskKey[Unit]("checkPom") := checkPom.value,
TaskKey[Unit]("checkExtra") := checkExtra.value,
TaskKey[Unit]("checkVersionPlusMapping") := checkVersionPlusMapping.value,
TaskKey[Unit]("checkAPIURL") := checkAPIURL.value,
TaskKey[Unit]("checkReleaseNotesURL") := checkReleaseNotesURL.value,
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 := {
val p = makePomConfiguration.value
@ -48,6 +50,11 @@ 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 ()

View File

@ -1,4 +1,5 @@
> checkPom
> checkExtra
> checkVersionPlusMapping
> checkAPIURL
> checkReleaseNotesURL