Minor refactoring

This commit is contained in:
Alexandre Archambault 2016-04-01 01:50:56 +02:00
parent 92fa4f38db
commit cffbe747ed
2 changed files with 14 additions and 7 deletions

View File

@ -149,12 +149,19 @@ case class MavenSource(
}
object MavenSource {
val typeExtensions: Map[String, String] = Map(
"eclipse-plugin" -> "jar",
"hk2-jar" -> "jar",
"orbit" -> "jar",
"scala-jar" -> "jar",
"jar" -> "jar",
"bundle" -> "jar",
"doc" -> "jar",
"src" -> "jar"
)
def typeExtension(`type`: String): String =
`type` match {
// see similar things in sbt-maven-resolver/src/main/scala/sbt/mavenint/MavenRepositoryResolver.scala in SBT 0.13.8
case "eclipse-plugin" | "hk2-jar" | "orbit" | "scala-jar" | "jar" | "bundle" | "doc" | "src" => "jar"
case other => other
}
typeExtensions.getOrElse(`type`, `type`)
}

View File

@ -230,7 +230,7 @@ object CentralTests extends TestSuite {
}
'packaging - {
* - {
'aar - {
// random aar-based module found on Central
ensureArtifactHasExtension(
Module("com.yandex.android", "speechkit"),
@ -239,7 +239,7 @@ object CentralTests extends TestSuite {
)
}
* - {
'bundle - {
// has packaging bundle - ensuring coursier gives its artifact the .jar extension
ensureArtifactHasExtension(
Module("com.google.guava", "guava"),