mirror of https://github.com/sbt/sbt.git
parent
9737a30a7d
commit
2e99fde9d2
|
|
@ -1001,4 +1001,13 @@ trait BuildCommon
|
|||
def classpath: Classpath = Attributed blankSeq s
|
||||
}
|
||||
def toError(o: Option[String]): Unit = o foreach error
|
||||
|
||||
def overrideConfigs(cs: Configuration*)(configurations: Seq[Configuration]): Seq[Configuration] =
|
||||
{
|
||||
val existingName = configurations.map(_.name).toSet
|
||||
val newByName = cs.map(c => (c.name, c)).toMap
|
||||
val overridden = configurations map { conf => newByName.getOrElse(conf.name, conf) }
|
||||
val newConfigs = cs filter { c => !existingName(c.name) }
|
||||
overridden ++ newConfigs
|
||||
}
|
||||
}
|
||||
|
|
@ -52,6 +52,7 @@ sealed trait Project extends ProjectDefinition[ProjectReference]
|
|||
apply(id, base, aggregate = resolveRefs(aggregate), dependencies = resolveDeps(dependencies), delegates = resolveRefs(delegates), settings, configurations)
|
||||
}
|
||||
|
||||
def overrideConfigs(cs: Configuration*): Project = copy(configurations = Defaults.overrideConfigs(cs : _*)(configurations))
|
||||
def dependsOn(deps: ClasspathDep[ProjectReference]*): Project = copy(dependencies = dependencies ++ deps)
|
||||
def delegateTo(from: ProjectReference*): Project = copy(delegates = delegates ++ from)
|
||||
def aggregate(refs: ProjectReference*): Project = copy(aggregate = (aggregate: Seq[ProjectReference]) ++ refs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue