You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/11/29 16:40:39 UTC

[GitHub] [daffodil] mbeckerle commented on a change in pull request #687: Add -release 8 to scalac and javac options

mbeckerle commented on a change in pull request #687:
URL: https://github.com/apache/daffodil/pull/687#discussion_r758541649



##########
File path: build.sbt
##########
@@ -200,14 +182,50 @@ lazy val commonSettings = Seq(
   testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "--verbosity=1"),
 ) ++ Defaults.itSettings
 
-def scalacCrossOptions(scalaVersion: String) =
-  CrossVersion.partialVersion(scalaVersion) match {
+
+def buildScalacOptions(scalaVersion: String) = {
+  val commonOptions = Seq(
+    "-target:jvm-1.8",
+    "-feature",
+    "-deprecation",
+    "-language:experimental.macros",
+    "-unchecked",
+    "-Xfatal-warnings",
+    "-Xxml:-coalescing",
+    "-Xfuture"
+  )
+
+  val scalaVersionSpecificOptions = CrossVersion.partialVersion(scalaVersion) match {
     case Some((2, 12)) => Seq(
       "-Ywarn-unused:imports"
     )
     case _ => Seq.empty
   }
 
+  val javaVersionSpecificOptions =
+    if (scala.util.Properties.isJavaAtLeast("9"))
+      Seq("-release", "8")
+    else
+      Seq.empty
+
+    commonOptions ++ scalaVersionSpecificOptions ++ javaVersionSpecificOptions
+}
+
+def buildJavacOptions() = {
+  val commonOptions = Seq(
+    "-Werror",
+    "-Xlint:deprecation"
+  )
+
+  val javaVersionSpecificOptions =

Review comment:
       Can you please just add comments to this code change - can just include a hint about the issue + a link to the JIRA issue discussion if you want. I just want this complexity in here to be well motivated. 
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org