/***
sbtPlugin := true
*/

import sbt._
import sbt.Keys._
object Build extends Build {
  lazy val projectA = project
  lazy val myTest = taskKey[Seq[Option[Tests.Output]]]("my test")
  lazy val root: Project = project in file(".") settings (myTest <<= myTestTask) dependsOn projectA

  def myTestTask = Def.task {
    val state: State = Keys.state.value
    val log: Logger = streams.value.log
    val extracted = Project.extract(state)
    import extracted._
    def noTestsMessage(scoped: ScopedKey[_])(implicit display: Show[ScopedKey[_]]): String =
      "No tests to run for " + display(scoped)
    def f(ref: ProjectReference) = for {
      state Pair Value(r) <- Project.runTask(executeTests in (ref, Test), state)
      _ = Tests.showResults(log, r, noTestsMessage(test in ref))
    } yield r
    val depsTests = currentProject.dependencies.map(_.project).map(f)
    val passed = depsTests.forall(_.forall(_.overall == TestResult.Passed))
    if (passed) depsTests :+ f(ThisProject) else depsTests
  }
}

        
  
Processing...
[info] Loading project definition from /tmp/rendererELeL0yS9q4/project/project
[info] Loading project definition from /tmp/rendererELeL0yS9q4/project
[info] Set current project to rendererWorker (in build file:/tmp/rendererELeL0yS9q4/)
[info] Reapplying settings...
[info] Set current project to rendererWorker (in build file:/tmp/rendererELeL0yS9q4/)
[info] Formatting 1 Scala source {file:/tmp/rendererELeL0yS9q4/}rendererWorker(compile) ...
[info] Reformatted 1 Scala source {file:/tmp/rendererELeL0yS9q4/}rendererWorker(compile).
[info] Updating {file:/tmp/rendererELeL0yS9q4/}rendererWorker...
[info] Resolving org.scala-lang#scala-library;2.10.2 ...
[info] Resolving org.scala-sbt#sbt;0.13.0 ...
[info] Resolving org.scala-sbt#main;0.13.0 ...
[info] Resolving org.scala-sbt#actions;0.13.0 ...
[info] Resolving org.scala-sbt#classpath;0.13.0 ...
[info] Resolving org.scala-sbt#launcher-interface;0.13.0 ...
[info] Resolving org.scala-sbt#interface;0.13.0 ...
[info] Resolving org.scala-sbt#io;0.13.0 ...
[info] Resolving org.scala-sbt#control;0.13.0 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.2 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.2 ...
[info] Resolving org.scala-sbt#completion;0.13.0 ...
[info] Resolving org.scala-sbt#collections;0.13.0 ...
[info] Resolving jline#jline;2.11 ...
[info] Resolving org.scala-sbt#api;0.13.0 ...
[info] Resolving org.scala-sbt#compiler-integration;0.13.0 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.0 ...
[info] Resolving org.scala-sbt#logging;0.13.0 ...
[info] Resolving org.scala-sbt#process;0.13.0 ...
[info] Resolving org.scala-sbt#relation;0.13.0 ...
[info] Resolving org.scala-sbt#compile;0.13.0 ...
[info] Resolving org.scala-sbt#persist;0.13.0 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...
[info] Resolving org.scala-sbt#classfile;0.13.0 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.0 ...
[info] Resolving org.scala-sbt#ivy;0.13.0 ...
[info] Resolving org.scala-sbt#cross;0.13.0 ...
[info] Resolving org.apache.ivy#ivy;2.3.0-rc1 ...
[info] Resolving com.jcraft#jsch;0.1.46 ...
[info] Resolving org.scala-sbt#run;0.13.0 ...
[info] Resolving org.scala-sbt#task-system;0.13.0 ...
[info] Resolving org.scala-sbt#tasks;0.13.0 ...
[info] Resolving org.scala-sbt#tracking;0.13.0 ...
[info] Resolving org.scala-sbt#cache;0.13.0 ...
[info] Resolving org.scala-sbt#testing;0.13.0 ...
[info] Resolving org.scala-sbt#test-agent;0.13.0 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.0 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.0 ...
[info] Resolving org.scala-sbt#command;0.13.0 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.0 ...
[info] Resolving org.scala-sbt#precompiled-2_8_2;0.13.0 ...
[info] Resolving org.scala-sbt#precompiled-2_9_2;0.13.0 ...
[info] Resolving org.scala-sbt#precompiled-2_9_3;0.13.0 ...
[info] Resolving org.scala-sbt.sxr#sxr_2.10;0.3.0 ...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving com.foursquare.lint#linter_2.10;0.1.2 ...
[info] Resolving org.scala-lang#jline;2.10.2 ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to /tmp/rendererELeL0yS9q4/target/classes...
[success] Total time: 10 s, completed Nov 27, 2013 3:21:43 AM
Now running...
[success] Total time: 0 s, completed Nov 27, 2013 3:21:43 AM