Do not fetch artifacts with a classifier from Ivy repositories if not

asked to do so
This commit is contained in:
Alexandre Archambault 2016-01-23 15:42:06 +01:00
parent 520fad9b46
commit 3e9a37edc3
2 changed files with 32 additions and 6 deletions

View File

@ -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) =>

View File

@ -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)
}
}
}