mirror of https://github.com/sbt/sbt.git
Merge pull request #2682 from xuwei-k/aggregate
`aggregate` can now be used inside a .sbt file
This commit is contained in:
commit
e843957e7c
|
|
@ -5,7 +5,8 @@ import internals.{
|
||||||
DslConfigs,
|
DslConfigs,
|
||||||
DslEnablePlugins,
|
DslEnablePlugins,
|
||||||
DslDisablePlugins,
|
DslDisablePlugins,
|
||||||
DslDependsOn
|
DslDependsOn,
|
||||||
|
DslAggregate
|
||||||
}
|
}
|
||||||
|
|
||||||
package object dsl {
|
package object dsl {
|
||||||
|
|
@ -13,4 +14,6 @@ package object dsl {
|
||||||
def disablePlugins(ps: AutoPlugin*): DslEntry = DslDisablePlugins(ps)
|
def disablePlugins(ps: AutoPlugin*): DslEntry = DslDisablePlugins(ps)
|
||||||
def configs(cs: Configuration*): DslEntry = DslConfigs(cs)
|
def configs(cs: Configuration*): DslEntry = DslConfigs(cs)
|
||||||
def dependsOn(deps: ClasspathDep[ProjectReference]*): DslEntry = DslDependsOn(deps)
|
def dependsOn(deps: ClasspathDep[ProjectReference]*): DslEntry = DslDependsOn(deps)
|
||||||
|
// avoid conflict with `sbt.Keys.aggregate`
|
||||||
|
def aggregateProjects(refs: ProjectReference*): DslEntry = DslAggregate(refs)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,3 +62,7 @@ case class DslConfigs(cs: Seq[Configuration]) extends ProjectManipulation {
|
||||||
case class DslDependsOn(cs: Seq[ClasspathDep[ProjectReference]]) extends ProjectManipulation {
|
case class DslDependsOn(cs: Seq[ClasspathDep[ProjectReference]]) extends ProjectManipulation {
|
||||||
override val toFunction: Project => Project = _.dependsOn(cs: _*)
|
override val toFunction: Project => Project = _.dependsOn(cs: _*)
|
||||||
}
|
}
|
||||||
|
/** this represents an `aggregate()` in the sbt DSL */
|
||||||
|
case class DslAggregate(refs: Seq[ProjectReference]) extends ProjectManipulation {
|
||||||
|
override val toFunction: Project => Project = _.aggregate(refs: _*)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
[@xuwei-k]: https://github.com/xuwei-k
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Add the ability to call aggregate for the current project inside a build sbt file. By [@xuwei-k][@xuwei-k]
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
aggregateProjects(
|
||||||
|
RootProject(file("projA"))
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
class A
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
name := "projA"
|
||||||
|
|
||||||
|
scalaVersion := "2.11.8"
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
> compile
|
||||||
|
$ exists projA/target/scala-2.11/classes/A.class
|
||||||
Loading…
Reference in New Issue