diff --git a/project/Sbt.scala b/project/Sbt.scala index 7413f1d57..a1e24a196 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -20,6 +20,7 @@ object Sbt extends Build publishMavenStyle := false, componentID := None, crossPaths := false, + concurrentRestrictions in Global += Util.testExclusiveRestriction, testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"), javacOptions in Compile ++= Seq("-target", "6", "-source", "6") ) @@ -70,7 +71,7 @@ object Sbt extends Build /* **** Intermediate-level Modules **** */ // Apache Ivy integration - lazy val ivySub = baseProject(file("ivy"), "Ivy") dependsOn(interfaceSub, launchInterfaceSub, logSub % "compile;test->test", ioSub % "compile;test->test", launchSub % "test->test") settings(ivy, jsch, httpclient) + lazy val ivySub = baseProject(file("ivy"), "Ivy") dependsOn(interfaceSub, launchInterfaceSub, logSub % "compile;test->test", ioSub % "compile;test->test", launchSub % "test->test") settings(ivy, jsch, httpclient, testExclusive) // Runner for uniform test interface lazy val testingSub = baseProject(file("testing"), "Testing") dependsOn(ioSub, classpathSub, logSub, launchInterfaceSub, testAgentSub) settings(libraryDependencies += "org.scala-tools.testing" % "test-interface" % "0.5") // Testing agent for running tests in a separate process. @@ -81,7 +82,7 @@ object Sbt extends Build // Basic task engine lazy val taskSub = testedBaseProject(tasksPath, "Tasks") dependsOn(controlSub, collectionSub) // Standard task system. This provides map, flatMap, join, and more on top of the basic task model. - lazy val stdTaskSub = testedBaseProject(tasksPath / "standard", "Task System") dependsOn(taskSub % "compile;test->test", collectionSub, logSub, ioSub, processSub) + lazy val stdTaskSub = testedBaseProject(tasksPath / "standard", "Task System") dependsOn(taskSub % "compile;test->test", collectionSub, logSub, ioSub, processSub) settings( testExclusive ) // Persisted caching based on SBinary lazy val cacheSub = baseProject(cachePath, "Cache") dependsOn(ioSub, collectionSub) settings(sbinary) // Builds on cache to provide caching for filesystem-related operations diff --git a/project/Util.scala b/project/Util.scala index 0c3c9a454..9cdc6de2a 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -4,6 +4,7 @@ object Util { + val ExclusiveTest = Tags.Tag("exclusive-test") lazy val componentID = SettingKey[Option[String]]("component-id") def inAll(projects: => Seq[ProjectReference], key: ScopedSetting[Task[Unit]]): Project.Initialize[Task[Unit]] = @@ -103,6 +104,15 @@ object Util def excludePomDependency(node: scala.xml.Node) = node \ "artifactId" exists { n => excludePomArtifact(n.text) } def excludePomArtifact(artifactId: String) = (artifactId == "compiler-interface") || (artifactId startsWith "precompiled") + + val testExclusive = tags in test += ( (ExclusiveTest, 1) ) + + // TODO: replace with Tags.exclusive after 0.12.0 + val testExclusiveRestriction = Tags.customLimit { (tags: Map[Tags.Tag,Int]) => + val exclusive = tags.getOrElse(ExclusiveTest, 0) + val all = tags.getOrElse(Tags.All, 0) + exclusive == 0 || all == 1 + } } object Common {