mirror of https://github.com/sbt/sbt.git
Move Maven specific method closer to its usage
This commit is contained in:
parent
ca17da83f1
commit
eaa7874874
|
|
@ -38,29 +38,6 @@ object Repository {
|
|||
)
|
||||
.withDefaultChecksums
|
||||
))
|
||||
def withJavadocSources: Artifact = {
|
||||
val base = underlying.url.stripSuffix(".jar")
|
||||
underlying.copy(extra = underlying.extra ++ Seq(
|
||||
"sources" -> Artifact(
|
||||
base + "-sources.jar",
|
||||
Map.empty,
|
||||
Map.empty,
|
||||
Attributes("jar", "src"), // Are these the right attributes?
|
||||
changing = underlying.changing
|
||||
)
|
||||
.withDefaultChecksums
|
||||
.withDefaultSignature,
|
||||
"javadoc" -> Artifact(
|
||||
base + "-javadoc.jar",
|
||||
Map.empty,
|
||||
Map.empty,
|
||||
Attributes("jar", "javadoc"), // Same comment as above
|
||||
changing = underlying.changing
|
||||
)
|
||||
.withDefaultChecksums
|
||||
.withDefaultSignature
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,32 @@ case class MavenSource(
|
|||
import Repository._
|
||||
import MavenRepository._
|
||||
|
||||
private implicit class DocSourcesArtifactExtensions(val underlying: Artifact) {
|
||||
def withJavadocSources: Artifact = {
|
||||
val base = underlying.url.stripSuffix(".jar")
|
||||
underlying.copy(extra = underlying.extra ++ Seq(
|
||||
"sources" -> Artifact(
|
||||
base + "-sources.jar",
|
||||
Map.empty,
|
||||
Map.empty,
|
||||
Attributes("jar", "src"), // Are these the right attributes?
|
||||
changing = underlying.changing
|
||||
)
|
||||
.withDefaultChecksums
|
||||
.withDefaultSignature,
|
||||
"javadoc" -> Artifact(
|
||||
base + "-javadoc.jar",
|
||||
Map.empty,
|
||||
Map.empty,
|
||||
Attributes("jar", "javadoc"), // Same comment as above
|
||||
changing = underlying.changing
|
||||
)
|
||||
.withDefaultChecksums
|
||||
.withDefaultSignature
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
def artifacts(
|
||||
dependency: Dependency,
|
||||
project: Project
|
||||
|
|
|
|||
Loading…
Reference in New Issue