From a0b1c17de590a973cce84dc4aad46b5ea737fae9 Mon Sep 17 00:00:00 2001 From: Geert Bevin Date: Tue, 4 Apr 2023 09:32:07 -0400 Subject: [PATCH] Updated readme --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2532e07..1021602 100644 --- a/README.md +++ b/README.md @@ -16,20 +16,27 @@ sources into the main source directories. ```java private final Antlr4Operation antlr4Operation_ = new Antlr4Operation(); -@BuildCommand + +@BuildCommand(summary = "Generates the grammar Java sources") public void generateGrammar() throws Exception { antlr4Operation_.executeOnce(o -> o .sourceDirectories(List.of(new File(srcMainDirectory(), "antlr"))) .outputDirectory(new File(buildDirectory(), "generated")) + // these options are specific to ANTLR4, please refer to the extension + // documentation to learn more about these and other option .visitor() .longMessages()); } -// compileOperation_ is part of the main project +@BuildCommand public void compile() throws Exception { + // always generate the latest grammar before compiling the sources generateGrammar(); + + // compileOperation_ is part of the main project, include the generated + // grammar with the main sources compileOperation_.executeOnce(o -> o .fromProject(this) .mainSourceDirectories(List.of(antlr4Operation_.outputDirectory())));