Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop node duplication in pom files #20019

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import java.io.File
import java.nio.file._
import scala.xml.{Elem, Node as XmlNode}

import Process._
import Modes._
Expand Down Expand Up @@ -2009,10 +2010,20 @@ object Build {
"scm:git:git@github.com:scala/scala3.git"
)
),
pomExtra :=
<properties>
<scala.versionLine>{versionLine}</scala.versionLine>
</properties>,
pomPostProcess := {
case node: Elem =>
if ((node\"properties").isEmpty)
node.copy(child = node.child :+ <properties><scala.versionLine>{versionLine}</scala.versionLine></properties>)
else {
val newChildren = node.child.map {
case elem: Elem if elem.label == "properties" =>
elem.copy(child = elem.child :+ <scala.versionLine>{versionLine}</scala.versionLine>)
case other =>
other
}
node.copy(child = newChildren)
}
},
developers := List(
Developer(
id = "odersky",
Expand Down
Loading