From 57adb5ff7a719d90dfce2e3adae46273912840b9 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 10 Apr 2014 10:05:15 -0400 Subject: [PATCH] Create test for configuration ordering regression. --- .../actions/configuration-delegation/build.sbt | 17 +++++++++++++++++ .../actions/configuration-delegation/test | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 sbt/src/sbt-test/actions/configuration-delegation/build.sbt create mode 100644 sbt/src/sbt-test/actions/configuration-delegation/test diff --git a/sbt/src/sbt-test/actions/configuration-delegation/build.sbt b/sbt/src/sbt-test/actions/configuration-delegation/build.sbt new file mode 100644 index 000000000..029644912 --- /dev/null +++ b/sbt/src/sbt-test/actions/configuration-delegation/build.sbt @@ -0,0 +1,17 @@ +lazy val foo = taskKey[Unit]("Runs the foo task") + +lazy val bar = taskKey[Unit]("Runs the bar task") + +def makeFoo(config: Configuration): Setting[_] = + foo in config := IO.write(file(s"${config.name}-foo"), "foo") + +lazy val PerformanceTest = (config("pt") extend Test) + +lazy val root = ( + (project in file(".")) + .configs(PerformanceTest) + .settings(Seq(Compile, Test, Runtime, PerformanceTest).map(makeFoo) :_*) + .settings( + bar in PerformanceTest := IO.write(file("pt-bar"), "bar") + ) +) \ No newline at end of file diff --git a/sbt/src/sbt-test/actions/configuration-delegation/test b/sbt/src/sbt-test/actions/configuration-delegation/test new file mode 100644 index 000000000..f0a77a058 --- /dev/null +++ b/sbt/src/sbt-test/actions/configuration-delegation/test @@ -0,0 +1,8 @@ +# First make sure a task just on the new config delegates. +> bar +$ exists pt-bar + + +# Now make sure compile is the default configuration +> foo +$ exists compile-foo \ No newline at end of file