mirror of https://github.com/sbt/sbt.git
Merge pull request #229 from alexarchambault/topic/extra-repos
Extra repos aliases, minor other things
This commit is contained in:
commit
51fefe5c29
|
|
@ -31,12 +31,12 @@ lazy val releaseSettings = Seq(
|
|||
else
|
||||
Some("releases" at nexus + "service/local/staging/deploy/maven2")
|
||||
},
|
||||
credentials += {
|
||||
credentials ++= {
|
||||
Seq("SONATYPE_USER", "SONATYPE_PASS").map(sys.env.get) match {
|
||||
case Seq(Some(user), Some(pass)) =>
|
||||
Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass)
|
||||
Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass))
|
||||
case _ =>
|
||||
Credentials(Path.userHome / ".ivy2" / ".credentials")
|
||||
Seq()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
@ -301,7 +301,7 @@ lazy val cli = project
|
|||
if (scalaVersion.value startsWith "2.10.")
|
||||
Seq()
|
||||
else
|
||||
Seq("com.github.alexarchambault" %% "case-app" % "1.0.0-RC1")
|
||||
Seq("com.github.alexarchambault" %% "case-app" % "1.0.0-RC2")
|
||||
},
|
||||
resourceGenerators in Compile += packageBin.in(bootstrap).in(Compile).map { jar =>
|
||||
Seq(jar)
|
||||
|
|
|
|||
|
|
@ -746,9 +746,7 @@ object Cache {
|
|||
}
|
||||
|
||||
lazy val ivy2Local = IvyRepository(
|
||||
ivy2HomeUri + "local/" +
|
||||
"[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/" +
|
||||
"[artifact](-[classifier]).[ext]",
|
||||
ivy2HomeUri + "local/" + coursier.ivy.Pattern.default,
|
||||
dropInfoAttributes = true
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import shapeless.union.Union
|
|||
case class CoursierCommandHelper(
|
||||
command: CoursierCommandHelper.U
|
||||
) extends ArgsApp {
|
||||
def setRemainingArgs(remainingArgs: Seq[String]): Unit =
|
||||
command.unify.setRemainingArgs(remainingArgs)
|
||||
def setRemainingArgs(remainingArgs: Seq[String], extraArgs: Seq[String]): Unit =
|
||||
command.unify.setRemainingArgs(remainingArgs, extraArgs)
|
||||
def remainingArgs: Seq[String] =
|
||||
command.unify.remainingArgs
|
||||
def apply(): Unit =
|
||||
|
|
|
|||
|
|
@ -51,23 +51,32 @@ class IsolatedClassLoader(
|
|||
|
||||
}
|
||||
|
||||
// should be in case-app somehow
|
||||
trait ExtraArgsApp extends caseapp.core.DefaultArgsApp {
|
||||
private var remainingArgs1 = Seq.empty[String]
|
||||
private var extraArgs1 = Seq.empty[String]
|
||||
|
||||
override def setRemainingArgs(remainingArgs: Seq[String], extraArgs: Seq[String]): Unit = {
|
||||
remainingArgs1 = remainingArgs
|
||||
extraArgs1 = extraArgs
|
||||
}
|
||||
|
||||
override def remainingArgs: Seq[String] =
|
||||
remainingArgs1
|
||||
def extraArgs: Seq[String] =
|
||||
extraArgs1
|
||||
}
|
||||
|
||||
case class Launch(
|
||||
@Recurse
|
||||
options: LaunchOptions
|
||||
) extends App {
|
||||
) extends App with ExtraArgsApp {
|
||||
|
||||
val (rawDependencies, extraArgs) = {
|
||||
val idxOpt = Some(remainingArgs.indexOf("--")).filter(_ >= 0)
|
||||
idxOpt.fold((remainingArgs, Seq.empty[String])) { idx =>
|
||||
val (l, r) = remainingArgs.splitAt(idx)
|
||||
assert(r.nonEmpty)
|
||||
(l, r.tail)
|
||||
}
|
||||
}
|
||||
val userArgs = extraArgs
|
||||
|
||||
val helper = new Helper(
|
||||
options.common,
|
||||
rawDependencies ++ options.isolated.rawIsolated.map { case (_, dep) => dep }
|
||||
remainingArgs ++ options.isolated.rawIsolated.map { case (_, dep) => dep }
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -194,10 +203,10 @@ case class Launch(
|
|||
}
|
||||
|
||||
if (options.common.verbosityLevel >= 2)
|
||||
Helper.errPrintln(s"Launching $mainClass0 ${extraArgs.mkString(" ")}")
|
||||
Helper.errPrintln(s"Launching $mainClass0 ${userArgs.mkString(" ")}")
|
||||
else if (options.common.verbosityLevel == 1)
|
||||
Helper.errPrintln(s"Launching")
|
||||
|
||||
Thread.currentThread().setContextClassLoader(loader)
|
||||
method.invoke(null, extraArgs.toArray)
|
||||
method.invoke(null, userArgs.toArray)
|
||||
}
|
||||
|
|
@ -9,6 +9,10 @@ import java.util.regex.Pattern.quote
|
|||
|
||||
object Pattern {
|
||||
|
||||
val default =
|
||||
"[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/" +
|
||||
"[artifact](-[classifier]).[ext]"
|
||||
|
||||
val propertyRegex = (quote("${") + "[^" + quote("{[()]}") + "]*" + quote("}")).r
|
||||
val optionalPartRegex = (quote("(") + "[^" + quote("{()}") + "]*" + quote(")")).r
|
||||
val variableRegex = (quote("[") + "[^" + quote("{[()]}") + "]*" + quote("]")).r
|
||||
|
|
|
|||
|
|
@ -132,6 +132,13 @@ object Parse {
|
|||
MavenRepository("https://repo1.maven.org/maven2")
|
||||
else if (s.startsWith("sonatype:"))
|
||||
MavenRepository(s"https://oss.sonatype.org/content/repositories/${s.stripPrefix("sonatype:")}")
|
||||
else if (s.startsWith("bintray:"))
|
||||
MavenRepository(s"https://dl.bintray.com/${s.stripPrefix("bintray:")}/maven")
|
||||
else if (s.startsWith("typesafe:ivy-"))
|
||||
IvyRepository(
|
||||
s"https://repo.typesafe.com/typesafe/ivy-" + s.stripPrefix("typesafe:ivy-") + "/" +
|
||||
coursier.ivy.Pattern.default
|
||||
)
|
||||
else if (s.startsWith("ivy:"))
|
||||
IvyRepository(s.stripPrefix("ivy:"))
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue