From 42252085ce01a259d7995c20e90e6a4524856faf Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Wed, 5 Jun 2019 17:54:24 +0300 Subject: [PATCH 1/3] add scalac option "-release 8"; --- build.sbt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 7b8e91e235..92e5e710ab 100644 --- a/build.sbt +++ b/build.sbt @@ -119,7 +119,10 @@ libraryDependencies ++= Seq( ) ++ testingDependencies -scalacOptions ++= Seq("-feature", "-deprecation") +scalacOptions ++= Seq("-feature", "-deprecation", + // to fix NoSuchMethodError for various ByteBuffer methods (see https://github.com/eclipse/jetty.project/issues/3244) + "-release", "8") + //uncomment lines below if the Scala compiler hangs to see where it happens //scalacOptions in Compile ++= Seq("-Xprompt", "-Ydebug", "-verbose" ) From af92bde53e25a559c7938e2a07d2160f5d9577d6 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Wed, 5 Jun 2019 21:04:30 +0300 Subject: [PATCH 2/3] disable packageDoc in publish; --- build.sbt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sbt b/build.sbt index 92e5e710ab..59329e301c 100644 --- a/build.sbt +++ b/build.sbt @@ -106,6 +106,8 @@ lazy val testSettings = Seq( publishArtifact in Test := true, publishArtifact in(Test, packageSrc) := true, publishArtifact in(Test, packageDoc) := false, + // TODO: fix this workaround for compiler crash with "-release 8" (see https://github.com/scala/community-builds/issues/796#issuecomment-423395500) + publishArtifact in(Compile, packageDoc) := false, test in assembly := {}) libraryDependencies ++= Seq( From 647af71226036f87160a4aa3118c04b606791e7c Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Thu, 6 Jun 2019 10:15:24 +0300 Subject: [PATCH 3/3] limit "release/target 8" option to "compile" task only (workaround for scalac crash on scaladoc); --- build.sbt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 59329e301c..52a54fc206 100644 --- a/build.sbt +++ b/build.sbt @@ -106,8 +106,6 @@ lazy val testSettings = Seq( publishArtifact in Test := true, publishArtifact in(Test, packageSrc) := true, publishArtifact in(Test, packageDoc) := false, - // TODO: fix this workaround for compiler crash with "-release 8" (see https://github.com/scala/community-builds/issues/796#issuecomment-423395500) - publishArtifact in(Compile, packageDoc) := false, test in assembly := {}) libraryDependencies ++= Seq( @@ -121,11 +119,16 @@ libraryDependencies ++= Seq( ) ++ testingDependencies -scalacOptions ++= Seq("-feature", "-deprecation", - // to fix NoSuchMethodError for various ByteBuffer methods (see https://github.com/eclipse/jetty.project/issues/3244) - "-release", "8") +scalacOptions ++= Seq("-feature", "-deprecation") +// set bytecode version to 8 to fix NoSuchMethodError for various ByteBuffer methods +// see https://github.com/eclipse/jetty.project/issues/3244 +// these options applied only in "compile" task since scalac crashes on scaladoc compilation with "-release 8" +// see https://github.com/scala/community-builds/issues/796#issuecomment-423395500 +javacOptions in(Compile, compile) ++= Seq("-target", "8", "-source", "8" ) +scalacOptions in(Compile, compile) ++= Seq("-release", "8") + //uncomment lines below if the Scala compiler hangs to see where it happens //scalacOptions in Compile ++= Seq("-Xprompt", "-Ydebug", "-verbose" )