mirror of https://github.com/sbt/sbt.git
Do not fetch artifacts with a classifier from Ivy repositories if not
asked to do so
This commit is contained in:
parent
520fad9b46
commit
3e9a37edc3
|
|
@ -61,9 +61,10 @@ case class IvyRepository(
|
|||
case None =>
|
||||
project.publications.collect {
|
||||
case (conf, p)
|
||||
if conf == "*" ||
|
||||
conf == dependency.configuration ||
|
||||
project.allConfigurations.getOrElse(dependency.configuration, Set.empty).contains(conf) =>
|
||||
if (conf == "*" ||
|
||||
conf == dependency.configuration ||
|
||||
project.allConfigurations.getOrElse(dependency.configuration, Set.empty).contains(conf)
|
||||
) && p.classifier.isEmpty =>
|
||||
p
|
||||
}
|
||||
case Some(classifiers) =>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,41 @@
|
|||
package coursier.test
|
||||
|
||||
import coursier.{ Module, Cache }
|
||||
import coursier.{ Dependency, Module, Cache }
|
||||
import coursier.test.compatibility._
|
||||
|
||||
import scala.async.Async.{ async, await }
|
||||
|
||||
import utest._
|
||||
|
||||
object IvyLocalTests extends TestSuite {
|
||||
|
||||
val tests = TestSuite{
|
||||
'coursier{
|
||||
val module = Module("com.github.alexarchambault", "coursier_2.11")
|
||||
val version = "1.0.0-SNAPSHOT"
|
||||
|
||||
val extraRepo = Some(Cache.ivy2Local)
|
||||
|
||||
// Assume this module (and the sub-projects it depends on) is published locally
|
||||
CentralTests.resolutionCheck(
|
||||
Module("com.github.alexarchambault", "coursier_2.11"), "1.0.0-SNAPSHOT",
|
||||
Some(Cache.ivy2Local))
|
||||
module, version,
|
||||
extraRepo
|
||||
)
|
||||
|
||||
|
||||
async {
|
||||
val res = await(CentralTests.resolve(
|
||||
Set(Dependency(module, version)),
|
||||
extraRepo = extraRepo
|
||||
))
|
||||
|
||||
val artifacts = res.artifacts.map(_.url)
|
||||
val anyJavadoc = artifacts.exists(_.contains("-javadoc"))
|
||||
val anySources = artifacts.exists(_.contains("-sources"))
|
||||
|
||||
assert(!anyJavadoc)
|
||||
assert(!anySources)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue