diff options
| author | Aditya Naik | 2024-05-29 17:28:22 -0700 |
|---|---|---|
| committer | Aditya Naik | 2024-05-29 17:28:22 -0700 |
| commit | bc92bb62f9f6a090e74392993e4fcfdd1f6b0676 (patch) | |
| tree | 160eb4cc2770eaf0c189fab9442d04b2b00b7919 /build.sbt | |
| parent | 878d488a7c8e0d6973de58b3164022c6a102e449 (diff) | |
i got 99 errors but "firrtl not found" aint one
Diffstat (limited to 'build.sbt')
| -rw-r--r-- | build.sbt | 273 |
1 files changed, 128 insertions, 145 deletions
@@ -2,13 +2,11 @@ import com.typesafe.tools.mima.core._ -enablePlugins(SiteScaladocPlugin) +Compile / compile / logLevel := Level.Error -val defaultVersions = Map( - "firrtl" -> "edu.berkeley.cs" %% "firrtl" % "1.5.6", - "treadle" -> "edu.berkeley.cs" %% "treadle" % "1.5.6", - "chiseltest" -> "edu.berkeley.cs" %% "chiseltest" % "0.5.6", -) +// enablePlugins(SiteScaladocPlugin) + +val scala3Version = "3.4.1" lazy val commonSettings = Seq ( resolvers ++= Seq( @@ -18,10 +16,10 @@ lazy val commonSettings = Seq ( organization := "edu.berkeley.cs", version := "3.5.6", autoAPIMappings := true, - scalaVersion := "2.12.17", - crossScalaVersions := Seq("2.13.10", "2.12.17"), - scalacOptions := Seq("-deprecation", "-feature"), - libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, + scalaVersion := scala3Version, + crossScalaVersions := Seq("2.13.10", "2.12.17", scala3Version), + scalacOptions := Seq("-rewrite", "-source:3.4-migration"), + // libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, // Macros paradise is integrated into 2.13 but requires a scalacOption scalacOptions ++= { CrossVersion.partialVersion(scalaVersion.value) match { @@ -29,12 +27,12 @@ lazy val commonSettings = Seq ( case _ => Nil } }, - libraryDependencies ++= { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, n)) if n >= 13 => Nil - case _ => compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full) :: Nil - } - } + // libraryDependencies ++= { + // CrossVersion.partialVersion(scalaVersion.value) match { + // case Some((2, n)) if n >= 13 => Nil + // case _ => compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full) :: Nil + // } + // } ) lazy val publishSettings = Seq ( @@ -72,114 +70,98 @@ lazy val publishSettings = Seq ( lazy val chiselSettings = Seq ( name := "chisel3", - - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.2.10" % "test", - "org.scalatestplus" %% "scalacheck-1-14" % "3.2.2.0" % "test", - "com.lihaoyi" %% "os-lib" % "0.8.0", - ), -) ++ ( - // Tests from other projects may still run concurrently - // if we're not running with -DminimalResources. - // Another option would be to experiment with: - // concurrentRestrictions in Global += Tags.limit(Tags.Test, 1), - sys.props.contains("minimalResources") match { - case true => Seq( Test / parallelExecution := false ) - case false => Seq( fork := true, - Test / testForkedParallel := true ) - } ) -autoCompilerPlugins := true +// autoCompilerPlugins := true // Plugin must be fully cross-versioned (published for Scala minor version) // The plugin only works in Scala 2.12+ -lazy val pluginScalaVersions = Seq( - // scalamacros paradise version used is not published for 2.12.0 and 2.12.1 - "2.12.2", - "2.12.3", - "2.12.4", - "2.12.5", - "2.12.6", - "2.12.7", - "2.12.8", - "2.12.9", - "2.12.10", - "2.12.11", - "2.12.12", - "2.12.13", - "2.12.14", - "2.12.15", - "2.12.16", - "2.12.17", - "2.13.0", - "2.13.1", - "2.13.2", - "2.13.3", - "2.13.4", - "2.13.5", - "2.13.6", - "2.13.7", - "2.13.8", - "2.13.9", - "2.13.10", -) +// lazy val pluginScalaVersions = Seq( +// // scalamacros paradise version used is not published for 2.12.0 and 2.12.1 +// "2.12.2", +// "2.12.3", +// "2.12.4", +// "2.12.5", +// "2.12.6", +// "2.12.7", +// "2.12.8", +// "2.12.9", +// "2.12.10", +// "2.12.11", +// "2.12.12", +// "2.12.13", +// "2.12.14", +// "2.12.15", +// "2.12.16", +// "2.12.17", +// "2.13.0", +// "2.13.1", +// "2.13.2", +// "2.13.3", +// "2.13.4", +// "2.13.5", +// "2.13.6", +// "2.13.7", +// "2.13.8", +// "2.13.9", +// "2.13.10", +// ) -lazy val plugin = (project in file("plugin")). - settings(name := "chisel3-plugin"). - settings(commonSettings: _*). - settings(publishSettings: _*). - settings( - libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value, - scalacOptions += "-Xfatal-warnings", - crossScalaVersions := pluginScalaVersions, - // Must be published for Scala minor version - crossVersion := CrossVersion.full, - crossTarget := { - // workaround for https://github.com/sbt/sbt/issues/5097 - target.value / s"scala-${scalaVersion.value}" - } - ). - settings( - // Given that the plugin is 1) a compile-time only dependency and 2) package chisel3.internal, - // I'm not really sure why we both checking binary compatbility - mimaBinaryIssueFilters ++= Seq( - // MyTypingTransformer is private (https://github.com/lightbend/mima/issues/53) - ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.internal.plugin.BundleComponent#MyTypingTransformer.isBundle"), - ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.internal.plugin.BundleComponent#MyTypingTransformer.getConstructorAndParams") - ), - mimaPreviousArtifacts := { - // There are not yet artifacts for 2.12.17, 2.13.9, nor 2.13.10; suppress until 3.5.5 is released - val skipVersions = Seq("2.12.17", "2.13.9", "2.13.10") - if (skipVersions.contains(scalaVersion.value)) { - Set() - } else { - Set("edu.berkeley.cs" % "chisel3-plugin" % "3.5.4" cross CrossVersion.full) - } - } - ) +// lazy val plugin = (project in file("plugin")). +// settings(name := "chisel3-plugin"). +// settings(commonSettings: _*). +// settings(publishSettings: _*). +// settings( +// // libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value, +// scalacOptions += "-Xfatal-warnings", +// crossScalaVersions := pluginScalaVersions, +// // Must be published for Scala minor version +// crossVersion := CrossVersion.full, +// crossTarget := { +// // workaround for https://github.com/sbt/sbt/issues/5097 +// target.value / s"scala-${scalaVersion.value}" +// } +// ). +// settings( +// // Given that the plugin is 1) a compile-time only dependency and 2) package chisel3.internal, +// // I'm not really sure why we both checking binary compatbility +// mimaBinaryIssueFilters ++= Seq( +// // MyTypingTransformer is private (https://github.com/lightbend/mima/issues/53) +// ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.internal.plugin.BundleComponent#MyTypingTransformer.isBundle"), +// ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.internal.plugin.BundleComponent#MyTypingTransformer.getConstructorAndParams") +// ), +// mimaPreviousArtifacts := { +// // There are not yet artifacts for 2.12.17, 2.13.9, nor 2.13.10; suppress until 3.5.5 is released +// val skipVersions = Seq("2.12.17", "2.13.9", "2.13.10") +// if (skipVersions.contains(scalaVersion.value)) { +// Set() +// } else { +// Set("edu.berkeley.cs" % "chisel3-plugin" % "3.5.4" cross CrossVersion.full) +// } +// } +// ) -lazy val usePluginSettings = Seq( - scalacOptions in Compile ++= { - val jar = (plugin / Compile / Keys.`package`).value - val addPlugin = "-Xplugin:" + jar.getAbsolutePath - // add plugin timestamp to compiler options to trigger recompile of - // main after editing the plugin. (Otherwise a 'clean' is needed.) - val dummy = "-Jdummy=" + jar.lastModified - Seq(addPlugin, dummy) - } -) +// lazy val usePluginSettings = Seq( +// scalacOptions in Compile ++= { +// val jar = (plugin / Compile / Keys.`package`).value +// val addPlugin = "-Xplugin:" + jar.getAbsolutePath +// // add plugin timestamp to compiler options to trigger recompile of +// // main after editing the plugin. (Otherwise a 'clean' is needed.) +// val dummy = "-Jdummy=" + jar.lastModified +// Seq(addPlugin, dummy) +// } +// ) -lazy val macros = (project in file("macros")). - settings(name := "chisel3-macros"). - settings(commonSettings: _*). - settings(publishSettings: _*). - settings(mimaPreviousArtifacts := Set("edu.berkeley.cs" %% "chisel3-macros" % "3.5.4")) +// lazy val macros = (project in file("macros")). +// settings(name := "chisel3-macros"). +// settings(commonSettings: _*). +// settings(publishSettings: _*). +// settings(mimaPreviousArtifacts := Set("edu.berkeley.cs" %% "chisel3-macros" % "3.5.4")) -lazy val firrtlRef = ProjectRef(workspaceDirectory / "firrtl", "firrtl") +// lazy val firrtlRef = ProjectRef(workspaceDirectory / "firrtl", "firrtl") lazy val core = (project in file("core")). - sourceDependency(firrtlRef, defaultVersions("firrtl")). + // sourceDependency(firrtlRef, defaultVersions("firrtl")). settings(commonSettings: _*). enablePlugins(BuildInfoPlugin). settings( @@ -189,6 +171,7 @@ lazy val core = (project in file("core")). ). settings(publishSettings: _*). settings( + libraryDependencies += "edu.berkeley.cs" % "firrtl_3" % "1.6-SNAPSHOT", mimaPreviousArtifacts := Set("edu.berkeley.cs" %% "chisel3-core" % "3.5.4"), mimaBinaryIssueFilters ++= Seq( // This is not a problem because the relevant method is implemented (and final) in Vec and Record @@ -227,33 +210,33 @@ lazy val core = (project in file("core")). "-Xlint:infer-any" // , "-Xlint:missing-interpolator" ) - ). - dependsOn(macros) + ) + // dependsOn(macros) // 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(".")). - enablePlugins(ScalaUnidocPlugin). + // enablePlugins(ScalaUnidocPlugin). settings(commonSettings: _*). settings(chiselSettings: _*). settings(publishSettings: _*). - settings(usePluginSettings: _*). - dependsOn(macros). + // settings(usePluginSettings: _*). + // dependsOn(macros). dependsOn(core). - aggregate(macros, core, plugin). + aggregate(core). settings( mimaPreviousArtifacts := Set("edu.berkeley.cs" %% "chisel3" % "3.5.4"), mimaBinaryIssueFilters ++= Seq( // Modified package private methods (https://github.com/lightbend/mima/issues/53) ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.stage.ChiselOptions.this"), ), - libraryDependencies += defaultVersions("treadle") % "test", - Test / scalacOptions += "-P:chiselplugin:genBundleElements", + // libraryDependencies += defaultVersions("treadle") % "test", + // Test / scalacOptions += "-P:chiselplugin:genBundleElements", // Forward doc command to unidoc - Compile / doc := (ScalaUnidoc / doc).value, + // Compile / doc := (ScalaUnidoc / doc).value, // Include unidoc as the ScalaDoc for publishing - Compile / packageDoc / mappings := (ScalaUnidoc / packageDoc / mappings).value, + // Compile / packageDoc / mappings := (ScalaUnidoc / packageDoc / mappings).value, scalacOptions in Test ++= Seq("-language:reflectiveCalls"), scalacOptions in Compile in doc ++= Seq( "-diagrams", @@ -274,13 +257,13 @@ lazy val chisel = (project in file(".")). } s"https://github.com/chipsalliance/chisel3/tree/$branch€{FILE_PATH_EXT}#L€{FILE_LINE}" } - ) ++ + ) // Suppress compiler plugin for source files in core // We don't need this in regular compile because we just don't add the chisel3-plugin to core's scalacOptions // This works around an issue where unidoc uses the exact same arguments for all source files. // This is probably fundamental to how ScalaDoc works so there may be no solution other than this workaround. // See https://github.com/sbt/sbt-unidoc/issues/107 - (core / Compile / sources).value.map("-P:chiselplugin:INTERNALskipFile:" + _) + // (core / Compile / sources).value.map("-P:chiselplugin:INTERNALskipFile:" + _) ) // tests elaborating and executing/formally verifying a Chisel circuit with chiseltest @@ -288,30 +271,30 @@ lazy val integrationTests = (project in file ("integration-tests")). dependsOn(chisel). settings(commonSettings: _*). settings(chiselSettings: _*). - settings(usePluginSettings: _*). + // settings(usePluginSettings: _*). settings(Seq( libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "0.5-SNAPSHOT" % "test" )) -lazy val docs = project // new documentation project - .in(file("docs-target")) // important: it must not be docs/ - .dependsOn(chisel) - .enablePlugins(MdocPlugin) - .settings(usePluginSettings: _*) - .settings(commonSettings) - .settings( - scalacOptions ++= Seq( - "-language:reflectiveCalls", - "-language:implicitConversions" - ), - mdocIn := file("docs/src"), - mdocOut := file("docs/generated"), - // None of our links are hygienic because they're primarily used on the website with .html - mdocExtraArguments := Seq("--cwd", "docs", "--no-link-hygiene"), - mdocVariables := Map( - "BUILD_DIR" -> "docs-target" // build dir for mdoc programs to dump temp files - ) - ) +// lazy val docs = project // new documentation project +// .in(file("docs-target")) // important: it must not be docs/ +// .dependsOn(chisel) +// // .enablePlugins(MdocPlugin) +// // .settings(usePluginSettings: _*) +// .settings(commonSettings) +// .settings( +// scalacOptions ++= Seq( +// "-language:reflectiveCalls", +// "-language:implicitConversions" +// ), +// mdocIn := file("docs/src"), +// mdocOut := file("docs/generated"), +// // None of our links are hygienic because they're primarily used on the website with .html +// mdocExtraArguments := Seq("--cwd", "docs", "--no-link-hygiene"), +// mdocVariables := Map( +// "BUILD_DIR" -> "docs-target" // build dir for mdoc programs to dump temp files +// ) +// ) addCommandAlias("com", "all compile") addCommandAlias("lint", "; compile:scalafix --check ; test:scalafix --check") |
