Skip to content

Commit b9695f0

Browse files
committed
Test deps conditional on TestKeys.includeTestDependencies
1 parent 43c1f5d commit b9695f0

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

build.sbt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,18 @@ pomExtra := (
7878
</developers>
7979
)
8080

81-
// for testing with partest
82-
libraryDependencies += "org.scala-lang.modules" %% "scala-partest-interface" % "0.2" % "test"
81+
// default value must be set here
82+
TestKeys.includeTestDependencies := true
8383

8484
// the actual partest the interface calls into -- must be binary version close enough to ours
8585
// so that it can link to the compiler/lib we're using (testing)
86-
libraryDependencies += "org.scala-lang.modules" %% "scala-partest" % "1.0-RC5" % "test"
86+
libraryDependencies ++= (
87+
if (TestKeys.includeTestDependencies.value)
88+
Seq("org.scala-lang.modules" %% "scala-partest" % "1.0-RC5" % "test",
89+
"org.scala-lang.modules" %% "scala-partest-interface" % "0.2" % "test")
90+
else Seq.empty
91+
)
92+
8793

8894
// necessary for partest -- see comments in its build.sbt
8995
conflictWarning ~= { _.copy(failOnConflict = false) }

project/keys.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object TestKeys {
2+
import sbt.settingKey
3+
4+
// for testing with partest
5+
val includeTestDependencies = settingKey[Boolean]("Doesn't declare test dependencies.")
6+
}

0 commit comments

Comments
 (0)