mirror of https://github.com/sbt/sbt.git
Add --classifier option
This commit is contained in:
parent
80807f4d93
commit
bccffaab6d
|
|
@ -50,6 +50,10 @@ case class CommonOptions(
|
|||
exclude: List[String],
|
||||
@Help("Consider provided dependencies to be intransitive. Applies to all the provided dependencies.")
|
||||
intransitive: Boolean,
|
||||
@Help("Classifiers that should be fetched")
|
||||
@Value("classifier1,classifier2,...")
|
||||
@Short("C")
|
||||
classifier: List[String],
|
||||
@Help("Maximum number of parallel downloads (default: 6)")
|
||||
@Short("n")
|
||||
parallel: Int = 6,
|
||||
|
|
@ -60,6 +64,7 @@ case class CommonOptions(
|
|||
cacheOptions: CacheOptions
|
||||
) {
|
||||
val verbose0 = verbose.length - (if (quiet) 1 else 0)
|
||||
lazy val classifier0 = classifier.flatMap(_.split(',')).filter(_.nonEmpty)
|
||||
}
|
||||
|
||||
case class CacheOptions(
|
||||
|
|
|
|||
|
|
@ -288,14 +288,14 @@ class Helper(
|
|||
val res0 = Option(subset).fold(res)(res.subset)
|
||||
|
||||
val artifacts =
|
||||
if (sources || javadoc) {
|
||||
var classifiers = Seq.empty[String]
|
||||
if (classifier0.nonEmpty || sources || javadoc) {
|
||||
var classifiers = classifier0
|
||||
if (sources)
|
||||
classifiers = classifiers :+ "sources"
|
||||
if (javadoc)
|
||||
classifiers = classifiers :+ "javadoc"
|
||||
|
||||
res0.classifiersArtifacts(classifiers)
|
||||
res0.classifiersArtifacts(classifiers.distinct)
|
||||
} else
|
||||
res0.artifacts
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue