Skip to content

Commit

Permalink
Add scalac workarounds for Scala 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mentegy committed May 10, 2017
1 parent 1601bc4 commit 3be6274
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions build.sbt
Expand Up @@ -222,7 +222,8 @@ def updateWebsiteTag =

lazy val commonSettings = ReleasePlugin.extraReleaseCommands ++ Seq(
organization := "io.getquill",
scalaVersion := "2.11.11",
// just for testing
scalaVersion := "2.12.2",
crossScalaVersions := Seq("2.11.11","2.12.2"),
libraryDependencies ++= Seq(
"org.scalamacros" %% "resetallattrs" % "1.0.0",
Expand Down Expand Up @@ -318,10 +319,18 @@ lazy val commonSettings = ReleasePlugin.extraReleaseCommands ++ Seq(
<url>http://github.com/fwbrasil/</url>
</developer>
</developers>)
) ++ update2_12
) ++ `scala 2.12 hacks`

lazy val update2_12 = Seq(
scalacOptions -= (
if (scalaVersion.value.startsWith("2.12.")) "-Xfatal-warnings" else ""
)
lazy val `scala 2.12 hacks` = Seq(
scalacOptions := {
val orig = scalacOptions.value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => Seq("-Xsource:2.11") ++ orig.map {
case "-Xlint" => "-Xlint:-unused,_"
case "-Ywarn-unused-import" => "-Ywarn-unused:imports,-patvars"
case other => other
}
case _ => orig
}
}
)
Expand Up @@ -842,7 +842,7 @@ class QuotationSpec extends Spec {
}
"abritrary" in {
val q = quote(lift(String.valueOf(1)))
q.liftings.`java.this.lang.String.valueOf(1)`.value mustEqual String.valueOf(1)
q.liftings.`java.lang.String.valueOf(1)`.value mustEqual String.valueOf(1)
}
"duplicate" in {
val i = 1
Expand Down

0 comments on commit 3be6274

Please sign in to comment.