mirror of https://github.com/sbt/sbt.git
Tweak Ivy repositories artifact handling
This commit is contained in:
parent
2775ef396b
commit
9968a12d10
|
|
@ -79,9 +79,12 @@ final case class IvyRepository(
|
|||
}
|
||||
else if (dependency.attributes.`type`.nonEmpty)
|
||||
project.publications.collect {
|
||||
case (_, p)
|
||||
if p.classifier.isEmpty && (
|
||||
p.`type` == dependency.attributes.`type` ||
|
||||
case (conf, p)
|
||||
if (conf == "*" ||
|
||||
conf == dependency.configuration ||
|
||||
project.allConfigurations.getOrElse(dependency.configuration, Set.empty).contains(conf)) &&
|
||||
(
|
||||
p.`type` == dependency.attributes.`type` ||
|
||||
(p.ext == dependency.attributes.`type` && project.packagingOpt.toSeq.contains(p.`type`)) // wow
|
||||
) =>
|
||||
p
|
||||
|
|
|
|||
|
|
@ -81,14 +81,26 @@ object IvyTests extends TestSuite {
|
|||
throw new Exception(s"Unexpected number of artifacts\n${other.mkString("\n")}")
|
||||
}
|
||||
|
||||
"test conf" - CentralTests.withArtifacts(
|
||||
dep = dep.copy(configuration = "test"),
|
||||
extraRepos = Seq(repo),
|
||||
classifierOpt = None
|
||||
) { artifacts =>
|
||||
val urls = artifacts.map(_.url).toSet
|
||||
assert(urls(mainJarUrl))
|
||||
assert(urls(testJarUrl))
|
||||
"test conf" - {
|
||||
"no attributes" - CentralTests.withArtifacts(
|
||||
dep = dep.copy(configuration = "test"),
|
||||
extraRepos = Seq(repo),
|
||||
classifierOpt = None
|
||||
) { artifacts =>
|
||||
val urls = artifacts.map(_.url).toSet
|
||||
assert(urls(mainJarUrl))
|
||||
assert(urls(testJarUrl))
|
||||
}
|
||||
|
||||
"attributes" - CentralTests.withArtifacts(
|
||||
dep = dep.copy(configuration = "test", attributes = Attributes("jar")),
|
||||
extraRepos = Seq(repo),
|
||||
classifierOpt = None
|
||||
) { artifacts =>
|
||||
val urls = artifacts.map(_.url).toSet
|
||||
assert(urls(mainJarUrl))
|
||||
assert(urls(testJarUrl))
|
||||
}
|
||||
}
|
||||
|
||||
"tests classifier" - {
|
||||
|
|
|
|||
Loading…
Reference in New Issue