Refine build.sbt. ignore no use middle files of scala.

This commit is contained in:
colin 2022-03-26 17:51:42 +00:00
parent d61bc07515
commit 5721e092bb
5 changed files with 45 additions and 49 deletions

7
.gitignore vendored
View File

@ -1,17 +1,12 @@
.metals/ .metals/
.vscode/ .vscode/
# design/project/target/ # design/project/target/
# design/project/project/ # design/project/project/
design/project/ design/project/
design/.idea/ design/.idea/
design/target/streams/ design/target/
design/target/.history
design/target/scala-2.12/
-design/target/scala-2.12/classes/wrapper*
generated_rtl/*.sv generated_rtl/*.sv
verif/sim/*.log verif/sim/*.log

View File

@ -1,56 +1,57 @@
// See README.md for license details. // ThisBuild / scalaVersion := "2.13.8"
// ThisBuild / version := "3.3.0"
// ThisBuild / organization := "COLIN"
def scalacOptionsVersion(scalaVersion: String): Seq[String] = { // mainClass in (Compile, run) := Some("QUASAR_Wrp")
Seq() ++ {
// If we're building with Scala > 2.11, enable the compile option
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, scalaMajor: Long)) if scalaMajor < 12 => Seq()
case _ => Seq("-Xsource:2.11")
}
}
}
def javacOptionsVersion(scalaVersion: String): Seq[String] = { // resolvers ++= Seq(
Seq() ++ { // Resolver.sonatypeRepo("snapshots"),
// Scala 2.12 requires Java 8. We continue to generate // Resolver.sonatypeRepo("releases")
// Java 7 compatible code for Scala 2.11 // )
// for compatibility with old clients.
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, scalaMajor: Long)) if scalaMajor < 12 =>
Seq("-source", "1.7", "-target", "1.7")
case _ =>
Seq("-source", "1.8", "-target", "1.8")
}
}
}
name := "QUASAR" // val chiselVersion = "3.5.2"
version := "3.3.0" // lazy val root = (project in file("."))
// .settings(
// name := "QUASAR",
// libraryDependencies ++= Seq(
// "edu.berkeley.cs" %% "chisel3" % chiselVersion,
// "edu.berkeley.cs" %% "chisel-iotesters" % "2.5.2",
// "edu.berkeley.cs" %% "chiseltest" % "0.5.2"
// ),
// scalacOptions ++= Seq(
// "-language:reflectiveCalls",
// "-deprecation",
// "-feature",
// "-Xcheckinit",
// "-P:chiselplugin:genBundleElements",
// "-Ymacro-annotations",
// ),
// addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full),
// )
scalaVersion := "2.12.10" ThisBuild / scalaVersion := "2.12.10"
ThisBuild / version := "3.3.0"
ThisBuild / organization := "COLIN"
// Making the main-class mainClass in (Compile, run) := Some("QUASAR_Wrp")
mainClass in (Compile, run) := Some("wrapper")
crossScalaVersions := Seq("2.12.10", "2.11.12")
resolvers ++= Seq( resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"), Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases") Resolver.sonatypeRepo("releases")
) )
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) lazy val root = (project in file("."))
.settings(
// Provide a managed dependency on X if -DXVersion="" is supplied on the command line. name := "QUASAR",
val defaultVersions = Seq( libraryDependencies ++= Seq(
"chisel-iotesters" -> "1.4.1+", "edu.berkeley.cs" %% "chisel-iotesters" % "1.4.1",
"chiseltest" -> "0.2.1+" "edu.berkeley.cs" %% "chiseltest" % "0.2.1+"
),
scalacOptions ++= Seq(
"-Xsource:2.11"
),
addCompilerPlugin(
"org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full
)
) )
libraryDependencies ++= defaultVersions.map { case (dep, ver) =>
"edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", ver) }
scalacOptions ++= scalacOptionsVersion(scalaVersion.value)
javacOptions ++= javacOptionsVersion(scalaVersion.value)