diff options
| author | Jim Lawson | 2016-12-12 09:14:33 -0800 |
|---|---|---|
| committer | GitHub | 2016-12-12 09:14:33 -0800 |
| commit | b581a24728bfba0c39ed2c032fd86f628a1e1a50 (patch) | |
| tree | f625219f936d39e760192aa69df17e776b95dd56 /build.sbt | |
| parent | 0bd9ae059368570dc72f25f7939afa5cfe5fd06e (diff) | |
| parent | ad53161bbb9f67e16b88ca7a508a537f88d77e05 (diff) | |
Merge branch 'master' into buildinfousepackageaspath
Diffstat (limited to 'build.sbt')
| -rw-r--r-- | build.sbt | 52 |
1 files changed, 29 insertions, 23 deletions
@@ -13,16 +13,28 @@ lazy val customUnidocSettings = unidocSettings ++ Seq ( target in unidoc in ScalaUnidoc := crossTarget.value / "api" ) +val defaultVersions = Map("firrtl" -> "1.1-SNAPSHOT") + lazy val commonSettings = Seq ( organization := "edu.berkeley.cs", version := "3.1-SNAPSHOT", git.remoteRepo := "git@github.com:ucb-bar/chisel3.git", autoAPIMappings := true, - scalaVersion := "2.11.7" + scalaVersion := "2.11.7", + scalacOptions := Seq("-deprecation", "-feature"), + // 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)) + } + } ) -val defaultVersions = Map("firrtl" -> "1.1-SNAPSHOT") - lazy val chiselSettings = Seq ( name := "chisel3", @@ -71,18 +83,6 @@ lazy val chiselSettings = Seq ( "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, @@ -97,16 +97,19 @@ lazy val chiselSettings = Seq ( lazy val coreMacros = (project in file("coreMacros")). settings(commonSettings: _*). settings( - libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value + libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, + publishArtifact := false ) lazy val chiselFrontend = (project in file("chiselFrontend")). settings(commonSettings: _*). settings( - libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value + libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, + publishArtifact := false ). dependsOn(coreMacros) + lazy val chisel = (project in file(".")). enablePlugins(BuildInfoPlugin). settings( @@ -119,14 +122,17 @@ lazy val chisel = (project in file(".")). settings(commonSettings: _*). settings(customUnidocSettings: _*). settings(chiselSettings: _*). - dependsOn(coreMacros). - dependsOn(chiselFrontend). + // Prevent separate JARs from being generated for coreMacros and chiselFrontend. + dependsOn(coreMacros % "compile-internal;test-internal"). + dependsOn(chiselFrontend % "compile-internal;test-internal"). settings( aggregate in doc := false, - // Include macro classes, resources, and sources main jar. + // Include macro classes, resources, and sources main JAR. mappings in (Compile, packageBin) <++= mappings in (coreMacros, Compile, packageBin), mappings in (Compile, packageSrc) <++= mappings in (coreMacros, Compile, packageSrc), mappings in (Compile, packageBin) <++= mappings in (chiselFrontend, Compile, packageBin), - mappings in (Compile, packageSrc) <++= mappings in (chiselFrontend, Compile, packageSrc) - ). - aggregate(coreMacros, chiselFrontend) + mappings in (Compile, packageSrc) <++= mappings in (chiselFrontend, Compile, packageSrc), + // Export the packaged JAR so projects that depend directly on Chisel project (rather than the + // published artifact) also see the stuff in coreMacros and chiselFrontend. + exportJars := true + ) |
