From f0ed145058329095ee4dd9c44b840146f6035dfc Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 29 Mar 2016 00:06:48 -0400 Subject: [PATCH] Port actions/depends-on --- sbt/src/sbt-test/actions/depends-on/build.sbt | 25 ++++++++++++++++ .../actions/depends-on/project/B.scala | 29 ------------------- 2 files changed, 25 insertions(+), 29 deletions(-) create mode 100644 sbt/src/sbt-test/actions/depends-on/build.sbt delete mode 100644 sbt/src/sbt-test/actions/depends-on/project/B.scala diff --git a/sbt/src/sbt-test/actions/depends-on/build.sbt b/sbt/src/sbt-test/actions/depends-on/build.sbt new file mode 100644 index 000000000..2a2dfbf7f --- /dev/null +++ b/sbt/src/sbt-test/actions/depends-on/build.sbt @@ -0,0 +1,25 @@ +// tests that errors are properly propagated for dependsOn, map, and flatMap + +lazy val root = (project in file(".")). + settings( + a <<= baseDirectory map (b => if( (b / "succeed").exists) () else sys.error("fail")), + b <<= a.task(at => nop dependsOn(at) ), + c <<= a map { _ => () }, + d <<= a flatMap { _ => task { () } } + ) +lazy val a = TaskKey[Unit]("a") +lazy val b = TaskKey[Unit]("b") +lazy val c = TaskKey[Unit]("c") +lazy val d = TaskKey[Unit]("d") + +lazy val input = (project in file("input")). + settings( + f <<= inputTask { _ map { args => if(args(0) == "succeed") () else sys.error("fail") } }, + j := sys.error("j"), + g <<= f dependsOn(j), + h <<= f map { _ => IO.touch(file("h")) } + ) +lazy val f = InputKey[Unit]("f") +lazy val g = InputKey[Unit]("g") +lazy val h = InputKey[Unit]("h") +lazy val j = TaskKey[Unit]("j") diff --git a/sbt/src/sbt-test/actions/depends-on/project/B.scala b/sbt/src/sbt-test/actions/depends-on/project/B.scala deleted file mode 100644 index 76120f6aa..000000000 --- a/sbt/src/sbt-test/actions/depends-on/project/B.scala +++ /dev/null @@ -1,29 +0,0 @@ -import sbt._ -import Keys._ -import Import._ - -// tests that errors are properly propagated for dependsOn, map, and flatMap -object B extends Build -{ - lazy val root = Project("root", file(".")) settings( - a <<= baseDirectory map (b => if( (b / "succeed").exists) () else sys.error("fail")), - b <<= a.task(at => nop dependsOn(at) ), - c <<= a map { _ => () }, - d <<= a flatMap { _ => task { () } } - ) - lazy val a = TaskKey[Unit]("a") - lazy val b = TaskKey[Unit]("b") - lazy val c = TaskKey[Unit]("c") - lazy val d = TaskKey[Unit]("d") - - lazy val input = Project("input", file("input")) settings( - f <<= inputTask { _ map { args => if(args(0) == "succeed") () else sys.error("fail") } }, - j := sys.error("j"), - g <<= f dependsOn(j), - h <<= f map { _ => IO.touch(file("h")) } - ) - lazy val f = InputKey[Unit]("f") - lazy val g = InputKey[Unit]("g") - lazy val h = InputKey[Unit]("h") - lazy val j = TaskKey[Unit]("j") -} \ No newline at end of file