This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new b154233  [SPARK-27016][SQL][BUILD][FOLLOW-UP] Treat all antlr warnings 
as errors while generating the parser.
b154233 is described below

commit b15423361bc28c4cd2216683eb852fdbec3ea58f
Author: Dilip Biswal <dbis...@us.ibm.com>
AuthorDate: Mon Mar 11 21:27:51 2019 -0700

    [SPARK-27016][SQL][BUILD][FOLLOW-UP] Treat all antlr warnings as errors 
while generating the parser.
    
    ## What changes were proposed in this pull request?
    Use the sbt maven plugin option`antlr4TreatWarningsAsErrors` to make sure 
the warnings are treated as errors while generating the parser. In the absence 
of it, we may inadvertently introduce problems while making grammar changes. 
Please refer to PR-23897 to know more about the context. We made a change in 
[pr-23925](https://github.com/apache/spark/pull/23925) which handled only the 
maven build.
    
    In this PR, we handle the sbt build. I had submitted 
[PR-23](https://github.com/ihji/sbt-antlr4/pull/23) to enhance the sbt-antlr 
plugin to make is possible to pass the error on warning option.
    
    ## How was this patch tested?
    Force an warning in the grammar file to check if the build fails. Then 
remove the warning to verify the build succeeds.
    
    Closes #24060 from dilipbiswal/sbt_build_antlr.
    
    Authored-by: Dilip Biswal <dbis...@us.ibm.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 project/SparkBuild.scala | 3 ++-
 project/plugins.sbt      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 659659f..59215a4 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -569,7 +569,8 @@ object Catalyst {
     antlr4Version in Antlr4 := 
SbtPomKeys.effectivePom.value.getProperties.get("antlr4.version").asInstanceOf[String],
     antlr4PackageName in Antlr4 := 
Some("org.apache.spark.sql.catalyst.parser"),
     antlr4GenListener in Antlr4 := true,
-    antlr4GenVisitor in Antlr4 := true
+    antlr4GenVisitor in Antlr4 := true,
+    antlr4TreatWarningsAsErrors in Antlr4 := true
   )
 }
 
diff --git a/project/plugins.sbt b/project/plugins.sbt
index c935473..21be62f 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -33,7 +33,7 @@ libraryDependencies += "org.ow2.asm"  % "asm" % "7.0"
 libraryDependencies += "org.ow2.asm"  % "asm-commons" % "7.0"
 
 // sbt 1.0.0 support: https://github.com/ihji/sbt-antlr4/issues/14
-addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.7.12")
+addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.7.13")
 
 // Spark uses a custom fork of the sbt-pom-reader plugin which contains a 
patch to fix issues
 // related to test-jar dependencies 
(https://github.com/sbt/sbt-pom-reader/pull/14). The source for


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to