How do I declare gradle Antlr task output specs to avoid unnecessary rebuilds
问题 I have a typical Antlr 4.5 project with two grammar files: MyLexer.g4 and MyParser.g4. From them, Antlr generates 6 output files: MyLexer.java, MyLexer.tokens, MyParser.java, MyParser.tokens, MyParserBaseListener.java and MyParserListener.java. The gradle tasks are all working correctly so that the output files are all generated, compiled and tested as expected. The problem is that gradle sees the 6 target files as always being out of date, so every run or debug session has to regenerate them