summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorJim Lawson2016-12-12 09:14:33 -0800
committerGitHub2016-12-12 09:14:33 -0800
commitb581a24728bfba0c39ed2c032fd86f628a1e1a50 (patch)
treef625219f936d39e760192aa69df17e776b95dd56 /build.sbt
parent0bd9ae059368570dc72f25f7939afa5cfe5fd06e (diff)
parentad53161bbb9f67e16b88ca7a508a537f88d77e05 (diff)
Merge branch 'master' into buildinfousepackageaspath
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt52
1 files changed, 29 insertions, 23 deletions
diff --git a/build.sbt b/build.sbt
index 3e2e0de7..f9b7c36d 100644
--- a/build.sbt
+++ b/build.sbt
@@ -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
+ )