mirror of https://github.com/sbt/sbt.git
Minor refacto
This commit is contained in:
parent
a6b9c845c2
commit
5559c5ce01
|
|
@ -90,20 +90,29 @@ final case class MavenRepository(
|
||||||
val root0 = if (root.endsWith("/")) root else root + "/"
|
val root0 = if (root.endsWith("/")) root else root + "/"
|
||||||
val source = MavenSource(root0, changing, sbtAttrStub, authentication)
|
val source = MavenSource(root0, changing, sbtAttrStub, authentication)
|
||||||
|
|
||||||
|
private def modulePath(
|
||||||
|
module: Module,
|
||||||
|
version: String
|
||||||
|
): Seq[String] =
|
||||||
|
module.organization.split('.').toSeq ++ Seq(
|
||||||
|
dirModuleName(module, sbtAttrStub),
|
||||||
|
version
|
||||||
|
)
|
||||||
|
|
||||||
|
private def urlFor(path: Seq[String]): String =
|
||||||
|
root0 + path.map(encodeURIComponent).mkString("/")
|
||||||
|
|
||||||
def projectArtifact(
|
def projectArtifact(
|
||||||
module: Module,
|
module: Module,
|
||||||
version: String,
|
version: String,
|
||||||
versioningValue: Option[String]
|
versioningValue: Option[String]
|
||||||
): Artifact = {
|
): Artifact = {
|
||||||
|
|
||||||
val path = module.organization.split('.').toSeq ++ Seq(
|
val path = modulePath(module, version) :+
|
||||||
dirModuleName(module, sbtAttrStub),
|
|
||||||
version,
|
|
||||||
s"${module.name}-${versioningValue getOrElse version}.pom"
|
s"${module.name}-${versioningValue getOrElse version}.pom"
|
||||||
)
|
|
||||||
|
|
||||||
Artifact(
|
Artifact(
|
||||||
root0 + path.map(encodeURIComponent).mkString("/"),
|
urlFor(path),
|
||||||
Map.empty,
|
Map.empty,
|
||||||
Map.empty,
|
Map.empty,
|
||||||
Attributes("pom", ""),
|
Attributes("pom", ""),
|
||||||
|
|
@ -123,7 +132,7 @@ final case class MavenRepository(
|
||||||
|
|
||||||
val artifact =
|
val artifact =
|
||||||
Artifact(
|
Artifact(
|
||||||
root0 + path.map(encodeURIComponent).mkString("/"),
|
urlFor(path),
|
||||||
Map.empty,
|
Map.empty,
|
||||||
Map.empty,
|
Map.empty,
|
||||||
Attributes("pom", ""),
|
Attributes("pom", ""),
|
||||||
|
|
@ -141,15 +150,11 @@ final case class MavenRepository(
|
||||||
version: String
|
version: String
|
||||||
): Option[Artifact] = {
|
): Option[Artifact] = {
|
||||||
|
|
||||||
val path = module.organization.split('.').toSeq ++ Seq(
|
val path = modulePath(module, version) :+ "maven-metadata.xml"
|
||||||
dirModuleName(module, sbtAttrStub),
|
|
||||||
version,
|
|
||||||
"maven-metadata.xml"
|
|
||||||
)
|
|
||||||
|
|
||||||
val artifact =
|
val artifact =
|
||||||
Artifact(
|
Artifact(
|
||||||
root0 + path.map(encodeURIComponent).mkString("/"),
|
urlFor(path),
|
||||||
Map.empty,
|
Map.empty,
|
||||||
Map.empty,
|
Map.empty,
|
||||||
Attributes("pom", ""),
|
Attributes("pom", ""),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue