summaryrefslogtreecommitdiff
path: root/build.sbt
blob: 982139e95d960f52f36648316842509d5a334fc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// See LICENSE for license details.

import com.typesafe.tools.mima.core._

Compile / compile / logLevel := Level.Error

val scala3Version = "3.4.2"

lazy val commonSettings = Seq (
  organization := "edu.berkeley.cs",
  version := "3.5.6",
  autoAPIMappings := true,
  scalaVersion := scala3Version,
  crossScalaVersions := Seq("2.13.10", "2.12.17", scala3Version),
  scalacOptions := Seq("-rewrite", "-source:3.4-migration")
)

lazy val chiselSettings = Seq (
  name := "chisel3",
)

lazy val core = (project in file("core")).
  settings(commonSettings: _*).
  enablePlugins(BuildInfoPlugin).
  settings(
    buildInfoPackage := "chisel3",
    buildInfoUsePackageAsPath := true,
    buildInfoKeys := Seq[BuildInfoKey](buildInfoPackage, version, scalaVersion, sbtVersion)
  ).
  settings(
    libraryDependencies += "edu.berkeley.cs" % "firrtl_3" % "1.6-SNAPSHOT",
  ).
  settings(
    name := "chisel3-core",
    scalacOptions := scalacOptions.value ++ Seq(
      "-explaintypes",
      "-feature",
      "-language:reflectiveCalls",
      "-unchecked",
    )
  )
  .dependsOn(macros)

lazy val macros = (project in file("macros"))
  .settings(name := "chisel-macros")
  .settings(commonSettings: _*)

// This will always be the root project, even if we are a sub-project.
lazy val root = RootProject(file("."))

lazy val chisel = (project in file(".")).
  settings(commonSettings: _*).
  settings(chiselSettings: _*).
  dependsOn(core).
  aggregate(core).
  settings(
    scalacOptions in Test ++= Seq("-language:reflectiveCalls"),
  )

addCommandAlias("com", "all compile")
addCommandAlias("lint", "; compile:scalafix --check ; test:scalafix --check")
addCommandAlias("fix", "all compile:scalafix test:scalafix")