mirror of https://github.com/sbt/sbt.git
Remove former classpath command (now fetch -p), get sources / javadoc via classifiers
This commit is contained in:
parent
0e5118befe
commit
fab18dd99b
|
|
@ -66,19 +66,28 @@ case class Fetch(
|
|||
@HelpMessage("Fetch javadoc artifacts")
|
||||
@ExtraName("D")
|
||||
javadoc: Boolean,
|
||||
@HelpMessage("Print java -cp compatible output")
|
||||
@ExtraName("p")
|
||||
classpath: Boolean,
|
||||
@Recurse
|
||||
common: CommonOptions
|
||||
) extends CoursierCommand {
|
||||
|
||||
val helper = new Helper(common, remainingArgs)
|
||||
|
||||
val files0 = helper.fetch(main = true, sources = false, javadoc = false)
|
||||
val files0 = helper.fetch(sources = false, javadoc = false)
|
||||
|
||||
println(
|
||||
files0
|
||||
.map(_.toString)
|
||||
.mkString("\n")
|
||||
)
|
||||
val out =
|
||||
if (classpath)
|
||||
files0
|
||||
.map(_.toString)
|
||||
.mkString(File.pathSeparator)
|
||||
else
|
||||
files0
|
||||
.map(_.toString)
|
||||
.mkString("\n")
|
||||
|
||||
println(out)
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +110,7 @@ case class Launch(
|
|||
|
||||
val helper = new Helper(common, rawDependencies)
|
||||
|
||||
val files0 = helper.fetch(main = true, sources = false, javadoc = false)
|
||||
val files0 = helper.fetch(sources = false, javadoc = false)
|
||||
|
||||
val cl = new URLClassLoader(
|
||||
files0.map(_.toURI.toURL).toArray,
|
||||
|
|
@ -169,23 +178,6 @@ case class Launch(
|
|||
method.invoke(null, extraArgs.toArray)
|
||||
}
|
||||
|
||||
case class Classpath(
|
||||
@Recurse
|
||||
common: CommonOptions
|
||||
) extends CoursierCommand {
|
||||
|
||||
val helper = new Helper(common, remainingArgs)
|
||||
|
||||
val files0 = helper.fetch(main = true, sources = false, javadoc = false)
|
||||
|
||||
Console.out.println(
|
||||
files0
|
||||
.map(_.toString)
|
||||
.mkString(File.pathSeparator)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
case class Bootstrap(
|
||||
@ExtraName("M")
|
||||
@ExtraName("main")
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ class Helper(
|
|||
}
|
||||
}
|
||||
|
||||
def fetch(main: Boolean, sources: Boolean, javadoc: Boolean): Seq[File] = {
|
||||
def fetch(sources: Boolean, javadoc: Boolean): Seq[File] = {
|
||||
if (verbose0 >= 0) {
|
||||
val msg = cachePolicies match {
|
||||
case Seq(CachePolicy.LocalOnly) =>
|
||||
|
|
@ -303,8 +303,18 @@ class Helper(
|
|||
|
||||
errPrintln(msg)
|
||||
}
|
||||
val artifacts0 = res.artifacts
|
||||
val main0 = main || (!sources && !javadoc)
|
||||
val artifacts0 =
|
||||
if (sources || javadoc) {
|
||||
var classifiers = Seq.empty[String]
|
||||
if (sources)
|
||||
classifiers = classifiers :+ "sources"
|
||||
if (javadoc)
|
||||
classifiers = classifiers :+ "javadoc"
|
||||
|
||||
res.classifiersArtifacts(classifiers)
|
||||
} else
|
||||
res.artifacts
|
||||
val main0 = !sources && !javadoc
|
||||
val artifacts = artifacts0.flatMap{ artifact =>
|
||||
var l = List.empty[Artifact]
|
||||
if (sources)
|
||||
|
|
|
|||
Loading…
Reference in New Issue