mirror of https://github.com/sbt/sbt.git
`aggregate` can now be used inside a .sbt file (#2683)
(cherry picked from commit b92e5773f7)
This commit is contained in:
parent
480a2f3040
commit
0c086a7761
|
|
@ -1,7 +1,7 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import sbt.internal.util.RangePosition
|
||||
import sbt.internal.util.{ Eval, RangePosition }
|
||||
|
||||
import sbt.librarymanagement.Configuration
|
||||
|
||||
|
|
@ -61,5 +61,8 @@ object DslEntry {
|
|||
case class DslConfigs(cs: Seq[Configuration]) extends ProjectManipulation {
|
||||
override val toFunction: Project => Project = _.configs(cs: _*)
|
||||
}
|
||||
|
||||
/** this represents an `aggregate()` in the sbt DSL */
|
||||
case class DslAggregate(refs: Seq[Eval[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]
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package sbt
|
||||
|
||||
import sbt.internal.DslEntry
|
||||
import sbt.internal.util.Eval
|
||||
|
||||
object syntax extends syntax
|
||||
|
||||
|
|
@ -51,6 +52,8 @@ abstract class syntax extends IOSyntax0 with sbt.std.TaskExtra with sbt.internal
|
|||
def enablePlugins(ps: AutoPlugin*): DslEntry = DslEntry.DslEnablePlugins(ps)
|
||||
def disablePlugins(ps: AutoPlugin*): DslEntry = DslEntry.DslDisablePlugins(ps)
|
||||
def configs(cs: Configuration*): DslEntry = DslEntry.DslConfigs(cs)
|
||||
// avoid conflict with `sbt.Keys.aggregate`
|
||||
def aggregateProjects(refs: Eval[ProjectReference]*): DslEntry = DslEntry.DslAggregate(refs)
|
||||
}
|
||||
|
||||
// Todo share this this io.syntax
|
||||
|
|
|
|||
|
|
@ -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