Re: [sbt] Running an aggregate task programatically

287 views
Skip to first unread message

Gerolf Seitz

unread,
Jul 26, 2012, 2:14:40 AM7/26/12
to simple-b...@googlegroups.com
You have to make sure that the task is properly scoped:

val extracted = Project.extract(state)
val thisRef = extracted.get(thisProjectRef) 
extracted.runAggregated(someTask in thisRef, state)

hth,
  Gerolf

On Wed, Jul 25, 2012 at 8:51 PM, Reuben Doetsch <hja...@gmail.com> wrote:
Hey guys,

Within a command I need to run a aggregate task on all my subprojects. I looked through the source and I know that I can call runAggregated on an extracted project, but it seems to not propagate through the various sub-projects.  I was going to start doing a deep dive into the source and hacking to find my solution, but thought someone might have run into a similar issue. 

Example code:

Project.extract(newST).runAggregated(syncDatabaseConfig,newST) 

Root project:

 lazy val root = Project(
    id = "chuck",
    base = file("."),
    settings = buildSettings("norris")
  ) settings (
    syncDatabaseConfig <<= syncDatabaseConfig
  ) aggregate ( api,admin,data,dataimport,logic, model,util,web )


Thanks in advance,

Reuben

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/-FUoUjIV-70J.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.



--
Gerolf Seitz

twitter: @gersei

Reuben Doetsch

unread,
Jul 27, 2012, 1:02:50 PM7/27/12
to simple-b...@googlegroups.com
Thanks works like a charm
To post to this group, send email to simple-build-tool@googlegroups.com.
To unsubscribe from this group, send email to simple-build-tool+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
Reply all
Reply to author
Forward
0 new messages