From b914564a62d73ff2abe433fbc782639dae5f346e Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 12 Dec 2017 18:12:30 -0800 Subject: [PATCH] Move build.scala -> build.sbt --- build.sbt | 43 ++++++++++++++++++++++++++++++++++++++++++ project/build.scala | 46 --------------------------------------------- 2 files changed, 43 insertions(+), 46 deletions(-) create mode 100644 build.sbt delete mode 100644 project/build.scala diff --git a/build.sbt b/build.sbt new file mode 100644 index 00000000..2feead24 --- /dev/null +++ b/build.sbt @@ -0,0 +1,43 @@ +// See LICENSE.Berkeley for license details. + +import sbt.complete._ +import sbt.complete.DefaultParsers._ +import xerial.sbt.Pack._ + +lazy val commonSettings = Seq( + organization := "berkeley", + version := "1.2", + scalaVersion := "2.11.12", + parallelExecution in Global := false, + traceLevel := 15, + scalacOptions ++= Seq("-deprecation","-unchecked"), + libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value), + addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) +) + +lazy val chisel = (project in file("chisel3")).settings(commonSettings) +lazy val hardfloat = project.dependsOn(chisel).settings(commonSettings) +lazy val macros = (project in file("macros")).settings(commonSettings) +lazy val rocketchip = (project in file(".")) + .settings(commonSettings, chipSettings) + .dependsOn(chisel, hardfloat, macros) + +lazy val addons = settingKey[Seq[String]]("list of addons used for this build") +lazy val make = inputKey[Unit]("trigger backend-specific makefile command") +val setMake = NotSpace ~ ( Space ~> NotSpace ) + +val chipSettings = packAutoSettings ++ Seq( + addons := { + val a = sys.env.getOrElse("ROCKETCHIP_ADDONS", "") + println(s"Using addons: $a") + a.split(" ") + }, + unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"), + mainClass in (Compile, run) := Some("rocketchip.Generator"), + make := { + val jobs = java.lang.Runtime.getRuntime.availableProcessors + val (makeDir, target) = setMake.parsed + (run in Compile).evaluated + s"make -C $makeDir -j $jobs $target" ! + } +) diff --git a/project/build.scala b/project/build.scala deleted file mode 100644 index 46a6f331..00000000 --- a/project/build.scala +++ /dev/null @@ -1,46 +0,0 @@ -// See LICENSE.Berkeley for license details. - -import sbt._ -import Keys._ -import complete._ -import complete.DefaultParsers._ -import xerial.sbt.Pack._ - -object BuildSettings extends Build { - - override lazy val settings = super.settings ++ Seq( - organization := "berkeley", - version := "1.2", - scalaVersion := "2.11.12", - parallelExecution in Global := false, - traceLevel := 15, - scalacOptions ++= Seq("-deprecation","-unchecked"), - libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value), - addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) - ) - - lazy val chisel = project in file("chisel3") - lazy val hardfloat = project.dependsOn(chisel) - lazy val macros = project in file("macros") - lazy val rocketchip = (project in file(".")).settings(chipSettings).dependsOn(chisel, hardfloat, macros) - - lazy val addons = settingKey[Seq[String]]("list of addons used for this build") - lazy val make = inputKey[Unit]("trigger backend-specific makefile command") - val setMake = NotSpace ~ ( Space ~> NotSpace ) - - val chipSettings = packAutoSettings ++ Seq( - addons := { - val a = sys.env.getOrElse("ROCKETCHIP_ADDONS", "") - println(s"Using addons: $a") - a.split(" ") - }, - unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"), - mainClass in (Compile, run) := Some("rocketchip.Generator"), - make := { - val jobs = java.lang.Runtime.getRuntime.availableProcessors - val (makeDir, target) = setMake.parsed - (run in Compile).evaluated - s"make -C $makeDir -j $jobs $target" ! - } - ) -}