Last active
August 29, 2015 14:13
-
-
Save rgoulter/0b8009d99fb1e81ada2e to your computer and use it in GitHub Desktop.
SBT for an Antlr4, Scala project. Can generate Eclipse, also.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "antlr-scala-c" | |
version := "0.1.3" | |
scalaVersion := "2.11.2" | |
antlr4Settings | |
antlr4GenListener in Antlr4 := true | |
antlr4GenVisitor in Antlr4 := true | |
antlr4Dependency in Antlr4 := "org.antlr" % "antlr4" % "4.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in project/sbt-antlr4.sbt | |
resolvers += "simplytyped.com" at "http://simplytyped.com/repo/releases" | |
addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.7.3") |
Antlr4 generated src went to target/scala-2.11/src_managed/main
.
Generated classes to target/scala-2.11/classes
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Can generate Eclipse" if SBT Eclipse plugin is installed 'globally'. Derp.
While this is much more terse than a comparable gradle script, the generated Eclipse project won't automatically recognise the Antlr4 file. After a
sbt compile
, SBT will handle generating the Antlr files (although these don't show up as part of the project's src). There isn't an Antlr-specific task for SBT.Perhaps with the Antlr4 Eclipse plugin, this could be mitigated by adding
src/main/antlr4
as a project src; though probably then SBT and Eclipse would diverge in where Antlr4 generates its sources.This seems more a vanity complaint than anything else, I guess.