Don't return duplicated artifacts from Ivy repos

This commit is contained in:
Alexandre Archambault 2017-06-05 18:57:26 +02:00
parent 4cdd95b37e
commit 69ffdeb553
4 changed files with 23 additions and 6 deletions

View File

@ -22,7 +22,7 @@ install:
Set-Location -Path ..
}
build_script:
- sbt ++2.11.11 clean compile coreJVM/publishLocal
- sbt ++2.11.11 clean compile coreJVM/publishLocal cli/publishLocal
- sbt ++2.12.1 http-server/publishLocal
- sbt ++2.10.6 clean compile
- sbt ++2.12.1 coreJVM/publishLocal cache/publishLocal extra/publishLocal # to make the scripted sbt 1.0 tests happy

View File

@ -88,7 +88,7 @@ final case class IvyRepository(
}
}
val retainedWithUrl = retained.flatMap { p =>
val retainedWithUrl = retained.distinct.flatMap { p =>
pattern.substituteVariables(variables(
dependency.module,
Some(project.actualVersion),

View File

@ -30,7 +30,7 @@ launchProxyRepos() {
integrationTestsRequirements() {
# Required for ~/.ivy2/local repo tests
sbt ++2.11.11 coreJVM/publishLocal
sbt ++2.11.11 coreJVM/publishLocal cli/publishLocal
sbt ++2.12.1 http-server/publishLocal

View File

@ -10,20 +10,37 @@ import utest._
object IvyLocalTests extends TestSuite {
val tests = TestSuite{
'coursier{
'coursier {
val module = Module("io.get-coursier", "coursier_2.11")
val version = coursier.util.Properties.version
val extraRepo = Some(Cache.ivy2Local)
// Assuming this module (and the sub-projects it depends on) is published locally
* - CentralTests.resolutionCheck(
'resolution - CentralTests.resolutionCheck(
module, version,
extraRepo
)
'uniqueArtifacts - async {
* - async {
val res = await(CentralTests.resolve(
Set(Dependency(Module("io.get-coursier", "coursier-cli_2.11"), version, transitive = false)),
extraRepo = extraRepo
))
val artifacts = res.dependencyClassifiersArtifacts(Seq("standalone"))
.map(_._2)
.filter(a => a.`type` == "jar" && !a.isOptional)
.map(_.url)
.groupBy(s => s)
assert(artifacts.nonEmpty)
assert(artifacts.forall(_._2.length == 1))
}
'javadocSources - async {
val res = await(CentralTests.resolve(
Set(Dependency(module, version)),
extraRepo = extraRepo