Merge pull request #2682 from xuwei-k/aggregate

`aggregate` can now be used inside a .sbt file
This commit is contained in:
eugene yokota 2016-07-25 03:26:03 -04:00 committed by GitHub
commit e843957e7c
7 changed files with 22 additions and 1 deletions

View File

@ -5,7 +5,8 @@ import internals.{
DslConfigs,
DslEnablePlugins,
DslDisablePlugins,
DslDependsOn
DslDependsOn,
DslAggregate
}
package object dsl {
@ -13,4 +14,6 @@ package object dsl {
def disablePlugins(ps: AutoPlugin*): DslEntry = DslDisablePlugins(ps)
def configs(cs: Configuration*): DslEntry = DslConfigs(cs)
def dependsOn(deps: ClasspathDep[ProjectReference]*): DslEntry = DslDependsOn(deps)
// avoid conflict with `sbt.Keys.aggregate`
def aggregateProjects(refs: ProjectReference*): DslEntry = DslAggregate(refs)
}

View File

@ -62,3 +62,7 @@ case class DslConfigs(cs: Seq[Configuration]) extends ProjectManipulation {
case class DslDependsOn(cs: Seq[ClasspathDep[ProjectReference]]) extends ProjectManipulation {
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: _*)
}

View File

@ -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]

View File

@ -0,0 +1,3 @@
aggregateProjects(
RootProject(file("projA"))
)

View File

@ -0,0 +1 @@
class A

View File

@ -0,0 +1,3 @@
name := "projA"
scalaVersion := "2.11.8"

View File

@ -0,0 +1,2 @@
> compile
$ exists projA/target/scala-2.11/classes/A.class