Search code examples
sbtantlrdoc

sbt doc error with Antler generated source code


I have ANTLR to generate parser/lexer code in "./gen" directory. With sbt, everything works fine; no issue with compile and test.

However, when I executed doc to invoke scaladoc, I have error messages saying that it cannot find the object that ANTLR generated.

> doc
[info] Main Scala API documentation to /Users/smcho/github/ChitchatCompilerScala/doc/api...
[error] /Users/smcho/github/ChitchatCompilerScala/src/main/scala/node/NodeGenerator.scala:6: not found: object parser
[error] import parser.{ChitchatLexer, ChitchatParser}
[error]        ^

What might be wrong?


Solution

  • I had to teach sbt about the new source directory.

    unmanagedSourceDirectories in Compile += baseDirectory.value / "extra-src"
    

    Hint from http://www.scala-sbt.org/0.13/docs/Howto-Customizing-Paths.html