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 Def.Setting
|
||||||
import sbt.Keys.{ csrProject, csrPublications, publishLocalConfiguration, publishConfiguration }
|
import sbt.Keys.{ csrProject, csrPublications, publishLocalConfiguration, publishConfiguration }
|
||||||
import sbt.ProjectExtra.*
|
import sbt.ProjectExtra.*
|
||||||
import sbt.librarymanagement.PublishConfiguration
|
|
||||||
import scala.jdk.CollectionConverters.*
|
import scala.jdk.CollectionConverters.*
|
||||||
import scala.xml.{ Node, PrefixedAttribute }
|
import scala.xml.{ Node, PrefixedAttribute }
|
||||||
|
|
||||||
|
|
@ -233,24 +232,13 @@ object IvyXml {
|
||||||
)
|
)
|
||||||
}.value)
|
}.value)
|
||||||
|
|
||||||
private lazy val needsIvyXmlLocal = Seq(publishLocalConfiguration) ++ getPubConf(
|
private lazy val needsIvyXmlLocal = Seq(publishLocalConfiguration) ++ List(
|
||||||
"makeIvyXmlLocalConfiguration"
|
sbt.Keys.makeIvyXmlLocalConfiguration
|
||||||
)
|
)
|
||||||
private lazy val needsIvyXml = Seq(publishConfiguration) ++ getPubConf(
|
private lazy val needsIvyXml = Seq(publishConfiguration) ++ List(
|
||||||
"makeIvyXmlConfiguration"
|
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(
|
def generateIvyXmlSettings(
|
||||||
shadedConfigOpt: Option[Configuration] = None
|
shadedConfigOpt: Option[Configuration] = None
|
||||||
): Seq[Setting[?]] =
|
): Seq[Setting[?]] =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue