mirror of https://github.com/sbt/sbt.git
Remove unnecessary reflection in IvyXml (#9024)
This commit is contained in:
parent
5ad9abac2f
commit
7ab07e1177
|
|
@ -18,7 +18,6 @@ import org.apache.ivy.core.module.id.ModuleRevisionId
|
|||
import Def.Setting
|
||||
import sbt.Keys.{ csrProject, csrPublications, publishLocalConfiguration, publishConfiguration }
|
||||
import sbt.ProjectExtra.*
|
||||
import sbt.librarymanagement.PublishConfiguration
|
||||
import scala.jdk.CollectionConverters.*
|
||||
import scala.xml.{ Node, PrefixedAttribute }
|
||||
|
||||
|
|
@ -233,24 +232,13 @@ object IvyXml {
|
|||
)
|
||||
}.value)
|
||||
|
||||
private lazy val needsIvyXmlLocal = Seq(publishLocalConfiguration) ++ getPubConf(
|
||||
"makeIvyXmlLocalConfiguration"
|
||||
private lazy val needsIvyXmlLocal = Seq(publishLocalConfiguration) ++ List(
|
||||
sbt.Keys.makeIvyXmlLocalConfiguration
|
||||
)
|
||||
private lazy val needsIvyXml = Seq(publishConfiguration) ++ getPubConf(
|
||||
"makeIvyXmlConfiguration"
|
||||
private lazy val needsIvyXml = Seq(publishConfiguration) ++ List(
|
||||
sbt.Keys.makeIvyXmlConfiguration
|
||||
)
|
||||
|
||||
private def getPubConf(method: String): List[TaskKey[PublishConfiguration]] =
|
||||
try {
|
||||
val cls = sbt.Keys.getClass
|
||||
val m = cls.getMethod(method)
|
||||
val task = m.invoke(sbt.Keys).asInstanceOf[TaskKey[PublishConfiguration]]
|
||||
List(task)
|
||||
} catch {
|
||||
case _: Throwable => // FIXME Too wide
|
||||
Nil
|
||||
}
|
||||
|
||||
def generateIvyXmlSettings(
|
||||
shadedConfigOpt: Option[Configuration] = None
|
||||
): Seq[Setting[?]] =
|
||||
|
|
|
|||
Loading…
Reference in New Issue