aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Lawson2017-09-14 09:41:56 -0700
committerGitHub2017-09-14 09:41:56 -0700
commitc5627f355767d4c4f5232fee81a61b7e8510672f (patch)
tree25a5c00745cd4743dc566f9a63774a30c5861825
parente2ad4650c73a33fa84f1b8d4aa84438feaefb153 (diff)
Update sbt to 0.13.16; add Scala 2.12 support. (#639)
* Update sbt to 0.13.16; add Scala 2.12 support. To clean, test, and build Scala 2.11 and Scala 2.12 versions: % sbt +clean +test +publishLocal * Update Travis to test in 2.11.11 and 2.12.3 * Try different way of providing Travis Scala version * Attempt to get verilator built before tests.
-rw-r--r--.travis.yml15
-rw-r--r--build.sbt59
-rw-r--r--project/assembly.sbt2
-rw-r--r--project/build.properties2
-rw-r--r--project/plugins.sbt10
-rw-r--r--project/sbt-antlr4.sbt2
6 files changed, 60 insertions, 30 deletions
diff --git a/.travis.yml b/.travis.yml
index 9b667a72..703d3f04 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
language: scala
scala:
- - 2.11
+ - 2.11.11
+ - 2.12.3
sudo: false
cache:
@@ -11,7 +12,7 @@ cache:
git:
depth: 10
-sbt_args: -Dsbt.log.noformat=true
+sbt_args: -Dsbt.log.noformat=true ++$TRAVIS_SCALA_VERSION
env:
global:
@@ -19,14 +20,14 @@ env:
VERILATOR_ROOT=$INSTALL_DIR
PATH=$PATH:$VERILATOR_ROOT/bin:$TRAVIS_BUILD_DIR/utils/bin
+before_script:
+ - bash .install_verilator.sh
+ - verilator --version
+
jobs:
include:
- - stage: prepare cache-verilator
- script:
- - bash .install_verilator.sh
- - verilator --version
+ - stage: Test
- &test
- stage: Test
script:
# FIRRTL Tests
- cd $TRAVIS_BUILD_DIR
diff --git a/build.sbt b/build.sbt
index 1bb393fc..637e2390 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,13 +2,11 @@
// sbt-site - sbt-ghpages
-site.settings
+enablePlugins(SiteScaladocPlugin)
-site.includeScaladoc()
+enablePlugins(GhpagesPlugin)
-ghpages.settings
-
-git.remoteRepo := "git@github.com:ucb-bar/firrtl.git"
+git.remoteRepo := "git@github.com:freechipsproject/firrtl.git"
// Firrtl code
@@ -20,19 +18,49 @@ version := "1.1-SNAPSHOT"
scalaVersion := "2.11.11"
-javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
+crossScalaVersions := Seq("2.11.11", "2.12.3")
+
+def scalacOptionsVersion(scalaVersion: String): Seq[String] = {
+ Seq() ++ {
+ // If we're building with Scala > 2.11, enable the compile option
+ // switch to support our anonymous Bundle definitions:
+ // https://github.com/scala/bug/issues/10047
+ CrossVersion.partialVersion(scalaVersion) match {
+ case Some((2, scalaMajor: Int)) if scalaMajor < 12 => Seq()
+ case _ => Seq("-Xsource:2.11")
+ }
+ }
+}
+
+scalacOptions := scalacOptionsVersion(scalaVersion.value)
+
+def javacOptionsVersion(scalaVersion: String): Seq[String] = {
+ Seq() ++ {
+ // Scala 2.12 requires Java 8, but we continue to generate
+ // Java 7 compatible code until we need Java 8 features
+ // for compatibility with old clients.
+ CrossVersion.partialVersion(scalaVersion) match {
+ case Some((2, scalaMajor: Int)) if scalaMajor < 12 =>
+ Seq("-source", "1.7", "-target", "1.7")
+ case _ =>
+ Seq("-source", "1.8", "-target", "1.8")
+ }
+ }
+}
+
+javacOptions ++= javacOptionsVersion(scalaVersion.value)
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
-libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.5.0"
+libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.7.2"
-libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.7"
+libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % "test"
-libraryDependencies += "com.github.scopt" %% "scopt" % "3.5.0"
+libraryDependencies += "com.github.scopt" %% "scopt" % "3.6.0"
libraryDependencies += "net.jcazevedo" %% "moultingyaml" % "0.4.0"
@@ -54,14 +82,15 @@ antlr4GenListener in Antlr4 := false // default = true
antlr4PackageName in Antlr4 := Option("firrtl.antlr")
+antlr4Version in Antlr4 := "4.7"
+
// ScalaDoc
-import UnidocKeys._
+enablePlugins(ScalaUnidocPlugin)
+
+doc in Compile := (doc in ScalaUnidoc).value
-lazy val customUnidocSettings = unidocSettings ++ Seq (
- doc in Compile := (doc in ScalaUnidoc).value,
- target in unidoc in ScalaUnidoc := crossTarget.value / "api"
-)
+//target in unidoc in ScalaUnidoc := crossTarget.value / "api"
autoAPIMappings := true
@@ -71,4 +100,4 @@ scalacOptions in Compile in doc ++= Seq(
"-doc-version", version.value,
"-doc-title", name.value,
"-doc-root-content", baseDirectory.value+"/root-doc.txt"
-)
+) ++ scalacOptionsVersion(scalaVersion.value)
diff --git a/project/assembly.sbt b/project/assembly.sbt
index 39c1bb84..15a88b09 100644
--- a/project/assembly.sbt
+++ b/project/assembly.sbt
@@ -1 +1 @@
-addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
diff --git a/project/build.properties b/project/build.properties
index 64317fda..c091b86c 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=0.13.15
+sbt.version=0.13.16
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 720470b8..6e7a9d28 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -4,14 +4,14 @@ resolvers += Classpaths.sbtPluginReleases
resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
-addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4")
+addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
-addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.2")
+addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.0")
-addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1")
+addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
-addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.3")
+addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
-addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
+addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
diff --git a/project/sbt-antlr4.sbt b/project/sbt-antlr4.sbt
index 06425044..cd995cc3 100644
--- a/project/sbt-antlr4.sbt
+++ b/project/sbt-antlr4.sbt
@@ -1,3 +1,3 @@
resolvers += Resolver.url("bintray-simplytyped", url("http://dl.bintray.com/simplytyped/sbt-plugins"))(Resolver.ivyStylePatterns)
-addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.7.11")
+addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.7.12")