diff options
| author | Jim Lawson | 2016-10-26 11:36:10 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2016-10-27 12:44:16 -0700 |
| commit | bf83e428bfc4cbdecf86e464fc343bb6a030bdaa (patch) | |
| tree | c97ec666a23ad170569debeae3d0e3e3cc2e735b /build.sbt | |
| parent | 72d3290ab5c536fef689da1ea719b2876440eadd (diff) | |
Use unmanagedClasspath and allDependencies to determine firrtl dependency.
Diffstat (limited to 'build.sbt')
| -rw-r--r-- | build.sbt | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -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, |
