[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoid re-generate Parser.jj on each build if the parser was not modified


I'm sure lots of us have seen during Maven build even though the sources
were not changed:
   Compiling 1155 source files to .../code/calcite/core/target/classes

The issue there is FMPP generates Parser.jj no matter what, and it causes
JavaCC to re-generate parser which causes maven-compiler-plugin to compile
calcite-core again.
Note: Maven sends all the files to javac and it assumes javac is
intelligent enough to identify which files were modified and which need to
be recompiled.

Unfortunately, regular javac is not incremental, and it basically builds
the whole source tree (see
https://issues.apache.org/jira/browse/MCOMPILER-209 )

I propose to use org.apache.drill.tools:drill-fmpp-maven-plugin instead of
Drill's fmpp plugin compares outputs, thus it skips overwrite of Parser.jj,
and it improves Calcite Core build times.
I'm sure IDEs would be happier since Parser.jj and the generated parser are
quite big and IDE won't have to re-parse it.

JIRA: https://issues.apache.org/jira/browse/CALCITE-2558
PR: https://github.com/apache/calcite/pull/832

>From my point of view this is an improvement with no drawbacks.
Any thoughts? Objections?