From e9e394093e4cb885ce11d597cd94b4c8f1a0e0ae Mon Sep 17 00:00:00 2001 From: vsalvis Date: Wed, 13 May 2015 12:18:39 +0200 Subject: Partest command line options (same as scala) useable from sbt --- project/Build.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'project') diff --git a/project/Build.scala b/project/Build.scala index 504185e65..271e54f87 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -74,12 +74,16 @@ object DottyBuild extends Build { partestLockFile.createNewFile partestLockFile.deleteOnExit }, - runPartestRunner <<= Def.taskDyn { + runPartestRunner <<= Def.inputTaskDyn { + // Magic! This is both an input task and a dynamic task. Apparently + // command line arguments get passed to the last task in an aliased + // sequence (see partest alias below), so this works. + val args = Def.spaceDelimited("").parsed val jars = Seq((packageBin in Compile).value.getAbsolutePath) ++ getJarPaths(partestDeps.value, ivyPaths.value.ivyHome) val dottyJars = "-dottyJars " + jars.length + " " + jars.mkString(" ") // Provide the jars required on the classpath of run tests - runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars) + runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars + " " + args.mkString(" ")) }, // Adjust classpath for running dotty @@ -170,7 +174,7 @@ object DottyBuild extends Build { lazy val partestLockFile = new File("." + File.separator + "tests" + File.separator + "locks" + File.separator + s"partest-$pid.lock") def pid = java.lang.Long.parseLong(java.lang.management.ManagementFactory.getRuntimeMXBean().getName().split("@")(0)) - lazy val runPartestRunner = TaskKey[Unit]("runPartestRunner", "Runs partest") + lazy val runPartestRunner = InputKey[Unit]("runPartestRunner", "Runs partest") lazy val partestDeps = SettingKey[Seq[ModuleID]]("partestDeps", "Finds jars for partest dependencies") def getJarPaths(modules: Seq[ModuleID], ivyHome: Option[File]): Seq[String] = ivyHome match { -- cgit v1.2.3