diff options
Diffstat (limited to 'project')
-rw-r--r-- | project/SparkBuild.scala | 54 | ||||
-rw-r--r-- | project/plugins.sbt | 3 |
2 files changed, 2 insertions, 55 deletions
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 39a9e16f7e..5d62b688b9 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -403,59 +403,9 @@ object OldDeps { object Catalyst { lazy val settings = antlr4Settings ++ Seq( - antlr4PackageName in Antlr4 := Some("org.apache.spark.sql.catalyst.parser.ng"), + antlr4PackageName in Antlr4 := Some("org.apache.spark.sql.catalyst.parser"), antlr4GenListener in Antlr4 := true, - antlr4GenVisitor in Antlr4 := true, - // ANTLR code-generation step. - // - // This has been heavily inspired by com.github.stefri.sbt-antlr (0.5.3). It fixes a number of - // build errors in the current plugin. - // Create Parser from ANTLR grammar files. - sourceGenerators in Compile += Def.task { - val log = streams.value.log - - val grammarFileNames = Seq( - "SparkSqlLexer.g", - "SparkSqlParser.g") - val sourceDir = (sourceDirectory in Compile).value / "antlr3" - val targetDir = (sourceManaged in Compile).value / "antlr3" - - // Create default ANTLR Tool. - val antlr = new org.antlr.Tool - - // Setup input and output directories. - antlr.setInputDirectory(sourceDir.getPath) - antlr.setOutputDirectory(targetDir.getPath) - antlr.setForceRelativeOutput(true) - antlr.setMake(true) - - // Add grammar files. - grammarFileNames.flatMap(gFileName => (sourceDir ** gFileName).get).foreach { gFilePath => - val relGFilePath = (gFilePath relativeTo sourceDir).get.getPath - log.info("ANTLR: Grammar file '%s' detected.".format(relGFilePath)) - antlr.addGrammarFile(relGFilePath) - // We will set library directory multiple times here. However, only the - // last one has effect. Because the grammar files are located under the same directory, - // We assume there is only one library directory. - antlr.setLibDirectory(gFilePath.getParent) - } - - // Generate the parser. - antlr.process() - val errorState = org.antlr.tool.ErrorManager.getErrorState - if (errorState.errors > 0) { - sys.error("ANTLR: Caught %d build errors.".format(errorState.errors)) - } else if (errorState.warnings > 0) { - sys.error("ANTLR: Caught %d build warnings.".format(errorState.warnings)) - } - - // Return all generated java files. - (targetDir ** "*.java").get.toSeq - }.taskValue, - // Include ANTLR tokens files. - resourceGenerators in Compile += Def.task { - ((sourceManaged in Compile).value ** "*.tokens").get.toSeq - }.taskValue + antlr4GenVisitor in Antlr4 := true ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index d9ed7962bf..4929ba3c4d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -22,9 +22,6 @@ libraryDependencies += "org.ow2.asm" % "asm" % "5.0.3" libraryDependencies += "org.ow2.asm" % "asm-commons" % "5.0.3" -libraryDependencies += "org.antlr" % "antlr" % "3.5.2" - - // TODO I am not sure we want such a dep. resolvers += "simplytyped" at "http://simplytyped.github.io/repo/releases" |