summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.sbt22
1 files changed, 13 insertions, 9 deletions
diff --git a/build.sbt b/build.sbt
index 4fd60fef..4ad1cf77 100644
--- a/build.sbt
+++ b/build.sbt
@@ -64,21 +64,25 @@ lazy val chiselSettings = Seq (
Resolver.sonatypeRepo("releases")
),
- libraryDependencies ++= Seq("firrtl").collect {
- // If we have an unmanaged jar file in the lib directory, assume we're to use that,
- case dep: String if (java.nio.file.Files.notExists(java.nio.file.Paths.get(s"${unmanagedBase.value}/$dep.jar"))) =>
- // otherwise let sbt fetch the appropriate version.
- "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep))
- // This should really be something like:
- // case dep: String if !unmanagedClasspath.value.contains(s"$dep.jar") => "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep))
- // but this generates - error: A setting cannot depend on a task
- } ++ Seq(
+ libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "2.2.5" % "test",
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scalacheck" %% "scalacheck" % "1.12.4" % "test",
"com.github.scopt" %% "scopt" % "3.4.0"
),
+ // Since we want to examine the classpath to determine if a dependency on firrtl is required,
+ // this has to be a Task setting.
+ // Fortunately, allDependencies is a Task Setting, so we can modify that.
+ allDependencies := {
+ allDependencies.value ++ Seq("firrtl").collect {
+ // If we have an unmanaged jar file on the classpath, assume we're to use that,
+ case dep: String if !(unmanagedClasspath in Compile).value.toString.contains(s"$dep.jar") =>
+ // otherwise let sbt fetch the appropriate version.
+ "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep))
+ }
+ },
+
// Tests from other projects may still run concurrently.
parallelExecution in Test := true,