ihji / sbt-antlr4

Antlr4 plugin for sbt 1.1+ and 0.13.x
57 stars 35 forks source link

Appends 'antlr4' to the javaSource directory for generated Java code. #7

Closed allertonm closed 8 years ago

allertonm commented 8 years ago

This fixes a problem that manifests itself when projects using this plugin are converted to IntelliJ projects using gen-idea. SBT expects plugins to put their generated source in a sub-directory of sourceManaged, named for the plugin. In order to support this, gen-idea appears to add the first level of directories under src_managed/main as "source paths" in the generated project, and so if you specify antlr4PackageName, the top level of the package hierarchy gets added as a project source path by accident. You can probably guess how well this works out.

Putting sbt-antlr4's generated code one level down, under 'antlr4', prevents this problem.

FranklinChen commented 8 years ago

Right. I've been using a workaround with

javaSource in Antlr4 := (javaSource in Antlr4).value / "antlr4"

but the default should be cleaner.

ihji commented 8 years ago

@allertonm Thanks for your contribution!

FranklinChen commented 8 years ago

Is a new version of the plugin going to be published?

ihji commented 8 years ago

@FranklinChen Sure. It's published now.