mirror of https://github.com/sbt/sbt.git
Support --repository bintray-ivy:org/repo/ in cli.
This commit adds support for a `bintray-ivy:` repository prefix to the `--repository` flag in the cli. This option is equivalent to the `Resolver.bintrayIvyRepo` helper in sbt. With this new helper, it's possible to write `-r bintray-ivy:scalameta/maven/` instead of ``` -r ivy:https://dl.bintray.com/scalameta/maven/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] ```
This commit is contained in:
parent
6c1b8ea7a4
commit
45b920c352
|
|
@ -29,6 +29,7 @@ final case class CommonOptions(
|
|||
@Short("N")
|
||||
maxIterations: Int = 100,
|
||||
@Help("Repository - for multiple repositories, separate with comma and/or add this option multiple times (e.g. -r central,ivy2local -r sonatype-snapshots, or equivalently -r central,ivy2local,sonatype-snapshots)")
|
||||
@Value("maven|sonatype:repo|ivy2local|bintray:org/repo|bintray-ivy:org/repo|typesafe-ivy:releases|ivy:pattern")
|
||||
@Short("r")
|
||||
repository: List[String] = Nil,
|
||||
@Help("Source repository - for multiple repositories, separate with comma and/or add this option multiple times")
|
||||
|
|
@ -282,4 +283,4 @@ final case class SparkSubmitOptions(
|
|||
artifactOptions: ArtifactOptions = ArtifactOptions(),
|
||||
@Recurse
|
||||
common: CommonOptions = CommonOptions()
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -188,6 +188,11 @@ object Parse {
|
|||
MavenRepository(s"https://oss.sonatype.org/content/repositories/${s.stripPrefix("sonatype:")}").right
|
||||
else if (s.startsWith("bintray:"))
|
||||
MavenRepository(s"https://dl.bintray.com/${s.stripPrefix("bintray:")}").right
|
||||
else if (s.startsWith("bintray-ivy:"))
|
||||
IvyRepository.fromPattern(
|
||||
s"https://dl.bintray.com/${s.stripPrefix("bintray-ivy:").stripSuffix("/")}" +: "/" +:
|
||||
coursier.ivy.Pattern.default
|
||||
).right
|
||||
else if (s.startsWith("typesafe:ivy-"))
|
||||
IvyRepository.fromPattern(
|
||||
(s"https://repo.typesafe.com/typesafe/ivy-" + s.stripPrefix("typesafe:ivy-") + "/") +:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package coursier.test
|
||||
|
||||
import scalaz.\/-
|
||||
|
||||
import coursier.MavenRepository
|
||||
import coursier.ivy.IvyRepository
|
||||
import coursier.util.Parse
|
||||
import utest._
|
||||
|
||||
object ParseTests extends TestSuite {
|
||||
val tests = TestSuite {
|
||||
"bintray-ivy:" - {
|
||||
val obtained = Parse.repository("bintray-ivy:scalameta/maven")
|
||||
assert(obtained.exists(_.isInstanceOf[IvyRepository]))
|
||||
}
|
||||
"bintray:" - {
|
||||
val obtained = Parse.repository("bintray:scalameta/maven")
|
||||
assert(obtained.exists(_.isInstanceOf[MavenRepository]))
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue