Skip to content

Commit

Permalink
Merge pull request #614 from coursier/topic/fix-compatibility-api
Browse files Browse the repository at this point in the history
Fix compatibility API
  • Loading branch information
alexarchambault committed Jul 19, 2017
2 parents 95f08e9 + 2815897 commit 5a271ff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Expand Up @@ -281,7 +281,7 @@ final case class MavenSource(
k -> other.extra.get(k).fold(v)(merge(v, _))
} ++
other.extra
.filterKeys(k => !a.extra.contains(k))
.filterKeys(k => !a.extra.contains(k) && k != Artifact.optionalKey)

a.copy(
checksumUrls = other.checksumUrls ++ a.checksumUrls,
Expand Down
17 changes: 17 additions & 0 deletions tests/shared/src/test/scala/coursier/test/CentralTests.scala
Expand Up @@ -804,6 +804,23 @@ abstract class CentralTests extends TestSuite {
val mainArtifactOpt = artifacts.find(_.url == mainUrl)
assert(mainArtifactOpt.isEmpty)
}

* - {
if (isActualCentral)
withArtifacts(Module("com.lihaoyi", "scalatags_2.12"), "0.6.2", "jar", transitive = true, optional = false) { artifacts =>

assert(artifacts.forall(!_.isOptional))

val urls = artifacts.map(_.url).toSet

val expectedUrls = Set(
"https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.0/scala-library-2.12.0.jar",
"https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.3/sourcecode_2.12-0.1.3.jar",
"https://repo1.maven.org/maven2/com/lihaoyi/scalatags_2.12/0.6.2/scalatags_2.12-0.6.2.jar"
)
assert(urls == expectedUrls)
}
}
}
}

Expand Down

0 comments on commit 5a271ff

Please sign in to comment.