選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

74 行
2.3KB

  1. def scalacOptionsVersion(scalaVersion: String): Seq[String] = {
  2. Seq() ++ {
  3. // If we're building with Scala > 2.11, enable the compile option
  4. // switch to support our anonymous Bundle definitions:
  5. // https://github.com/scala/bug/issues/10047
  6. CrossVersion.partialVersion(scalaVersion) match {
  7. case Some((2, scalaMajor: Long)) if scalaMajor < 12 => Seq()
  8. case _ => Seq("-Xsource:2.11")
  9. }
  10. }
  11. }
  12. def javacOptionsVersion(scalaVersion: String): Seq[String] = {
  13. Seq() ++ {
  14. // Scala 2.12 requires Java 8. We continue to generate
  15. // Java 7 compatible code for Scala 2.11
  16. // for compatibility with old clients.
  17. CrossVersion.partialVersion(scalaVersion) match {
  18. case Some((2, scalaMajor: Long)) if scalaMajor < 12 =>
  19. Seq("-source", "1.7", "-target", "1.7")
  20. case _ =>
  21. Seq("-source", "1.8", "-target", "1.8")
  22. }
  23. }
  24. }
  25. name := "chisel intro"
  26. version := "3.1.0"
  27. scalaVersion := "2.12.8"
  28. crossScalaVersions := Seq("2.11.12", "2.12.4")
  29. resolvers ++= Seq(
  30. Resolver.sonatypeRepo("snapshots"),
  31. Resolver.sonatypeRepo("releases")
  32. )
  33. // Provide a managed dependency on X if -DXVersion="" is supplied on the command line.
  34. val defaultVersions = Map(
  35. "chisel3" -> "3.1.+",
  36. "chisel-iotesters" -> "1.2.+"
  37. )
  38. libraryDependencies ++= (Seq("chisel3","chisel-iotesters").map {
  39. dep: String => "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep)) })
  40. val versionOfScala = "2.12.4"
  41. val fs2Version = "0.10.3"
  42. val catsVersion = "1.1.0"
  43. val catsEffectVersion = "0.10"
  44. libraryDependencies ++= Dependencies.backendDeps.value
  45. scalacOptions ++= scalacOptionsVersion(scalaVersion.value)
  46. scalacOptions ++= Seq("-language:reflectiveCalls")
  47. javacOptions ++= javacOptionsVersion(scalaVersion.value)
  48. // testOptions in Test += Tests.Argument("-oF")
  49. resolvers += Resolver.sonatypeRepo("releases")
  50. addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7")
  51. addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.2.4")
  52. addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)
  53. testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-eS")
  54. run := Defaults.runTask(fullClasspath in Runtime, mainClass in run in Compile, runner in run).evaluated
  55. cancelable in Global := true
  56. fork := true