mirror of https://github.com/sbt/sbt.git
include 'bundle' packaging type on classpath in addition to 'jar'
This commit is contained in:
parent
cc1e02f6a3
commit
dd012099d2
|
|
@ -71,6 +71,7 @@ object Defaults
|
||||||
sbtPlugin :== false,
|
sbtPlugin :== false,
|
||||||
crossPaths :== true,
|
crossPaths :== true,
|
||||||
generatedResources :== Nil,
|
generatedResources :== Nil,
|
||||||
|
classpathTypes := Set("jar", "bundle"),
|
||||||
// shellPrompt :== (_ => "> "),
|
// shellPrompt :== (_ => "> "),
|
||||||
aggregate :== Aggregation.Enabled,
|
aggregate :== Aggregation.Enabled,
|
||||||
maxErrors :== 100,
|
maxErrors :== 100,
|
||||||
|
|
@ -426,7 +427,7 @@ object Classpaths
|
||||||
internalDependencyClasspath <<= internalDependencies,
|
internalDependencyClasspath <<= internalDependencies,
|
||||||
unmanagedClasspath <<= unmanagedDependencies,
|
unmanagedClasspath <<= unmanagedDependencies,
|
||||||
products <<= makeProducts,
|
products <<= makeProducts,
|
||||||
managedClasspath <<= (configuration, update) map managedJars,
|
managedClasspath <<= (configuration, classpathTypes, update) map managedJars,
|
||||||
unmanagedJars <<= (configuration, unmanagedBase, classpathFilter, defaultExcludes) map { (config, base, filter, excl) =>
|
unmanagedJars <<= (configuration, unmanagedBase, classpathFilter, defaultExcludes) map { (config, base, filter, excl) =>
|
||||||
(base * (filter -- excl) +++ (base / config.name).descendentsExcept(filter, excl)).getFiles
|
(base * (filter -- excl) +++ (base / config.name).descendentsExcept(filter, excl)).getFiles
|
||||||
}
|
}
|
||||||
|
|
@ -701,7 +702,7 @@ object Classpaths
|
||||||
flatten(defaultConfiguration in p get data) getOrElse Configurations.Default
|
flatten(defaultConfiguration in p get data) getOrElse Configurations.Default
|
||||||
def flatten[T](o: Option[Option[T]]): Option[T] = o flatMap identity
|
def flatten[T](o: Option[Option[T]]): Option[T] = o flatMap identity
|
||||||
|
|
||||||
def managedJars(config: Configuration, up: UpdateReport): Classpath = managedFiles(config, up)(isJar)
|
def managedJars(config: Configuration, jarTypes: Set[String], up: UpdateReport): Classpath = managedFiles(config, up)(isJar(jarTypes))
|
||||||
def allFiles(up: UpdateReport): Seq[File] = data( up.configurations flatMap { cr => allJars(cr)(_ => true) }).distinct
|
def allFiles(up: UpdateReport): Seq[File] = data( up.configurations flatMap { cr => allJars(cr)(_ => true) }).distinct
|
||||||
def managedFiles(config: Configuration, up: UpdateReport)(pred: Artifact => Boolean): Classpath =
|
def managedFiles(config: Configuration, up: UpdateReport)(pred: Artifact => Boolean): Classpath =
|
||||||
allJars( confReport(config.name, up) )(pred)
|
allJars( confReport(config.name, up) )(pred)
|
||||||
|
|
@ -709,7 +710,8 @@ object Classpaths
|
||||||
up.configuration(config) getOrElse error("Configuration '" + config + "' unresolved by 'update'.")
|
up.configuration(config) getOrElse error("Configuration '" + config + "' unresolved by 'update'.")
|
||||||
def allJars(cr: ConfigurationReport)(pred: Artifact => Boolean): Seq[File] = cr.modules.flatMap(mr => allJars(mr.artifacts)(pred))
|
def allJars(cr: ConfigurationReport)(pred: Artifact => Boolean): Seq[File] = cr.modules.flatMap(mr => allJars(mr.artifacts)(pred))
|
||||||
def allJars(as: Seq[(Artifact,File)])(pred: Artifact => Boolean): Seq[File] = as collect { case (a, f) if pred(a) => f }
|
def allJars(as: Seq[(Artifact,File)])(pred: Artifact => Boolean): Seq[File] = as collect { case (a, f) if pred(a) => f }
|
||||||
def isJar(a: Artifact): Boolean = a.`type` == "jar"
|
def isJar(jarTypes: Set[String])(a: Artifact): Boolean =
|
||||||
|
jarTypes contains a.`type`
|
||||||
|
|
||||||
lazy val dbResolver = Resolver.url("sbt-db", new URL("http://databinder.net/repo/"))(Resolver.ivyStylePatterns)
|
lazy val dbResolver = Resolver.url("sbt-db", new URL("http://databinder.net/repo/"))(Resolver.ivyStylePatterns)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ object Keys
|
||||||
val autoUpdate = SettingKey[Boolean]("auto-update")
|
val autoUpdate = SettingKey[Boolean]("auto-update")
|
||||||
val retrieveManaged = SettingKey[Boolean]("retrieve-managed")
|
val retrieveManaged = SettingKey[Boolean]("retrieve-managed")
|
||||||
val managedDirectory = SettingKey[File]("managed-directory")
|
val managedDirectory = SettingKey[File]("managed-directory")
|
||||||
|
val classpathTypes = SettingKey[Set[String]]("classpath-types")
|
||||||
|
|
||||||
val sbtResolver = SettingKey[Resolver]("sbt-resolver")
|
val sbtResolver = SettingKey[Resolver]("sbt-resolver")
|
||||||
val sbtDependency = SettingKey[ModuleID]("sbt-dependency")
|
val sbtDependency = SettingKey[ModuleID]("sbt-dependency")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue