Skip to content

Commit a7b4d78

Browse files
committed
Generate Flux parser and lexer as part of the build cycle
This commit updates the maven configuration to generate the code files for the parser and lexer for Flux during the build process. The pre-generated code files for the Flux parser and lexer are removed from the repository. This change can cause peculiar errors if you do a `mvn clean` followed by a `mvn install` while the project is opened in eclipse (or possibly any other IDE that automatically compiles sources in the background). The reason for this is that eclipe starts compiling the source files again as soon as `mvn clean` completes. However, at this point the files generated by antlr are not yet re-generated (and eclipse does not generate them) so any files relying on these generated files will fail to compile. The best approach to avoid problems during `mvn clean` is to close the project in eclipse, run `mvn clean test` on the command line and only open the project again once this has finished. Subsequently, eclipse background complilation should work well. This commit also updates the antlr version to 3.5.1.
1 parent 27c2390 commit a7b4d78

File tree

6 files changed

+17
-3977
lines changed

6 files changed

+17
-3977
lines changed

pom.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<properties>
6262
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6363
<targetJdk>1.6</targetJdk>
64+
<antlr.version>3.5.1</antlr.version>
6465
</properties>
6566

6667
<scm>
@@ -142,11 +143,26 @@
142143
<configuration>
143144
<sources>
144145
<source>src/main/antlr3</source>
146+
<source>target/generated-sources/antlr3</source>
145147
</sources>
146148
</configuration>
147149
</execution>
148150
</executions>
149151
</plugin>
152+
153+
<plugin>
154+
<groupId>org.antlr</groupId>
155+
<artifactId>antlr3-maven-plugin</artifactId>
156+
<version>${antlr.version}</version>
157+
<executions>
158+
<execution>
159+
<id>generate-parser</id>
160+
<goals>
161+
<goal>antlr</goal>
162+
</goals>
163+
</execution>
164+
</executions>
165+
</plugin>
150166

151167
<plugin>
152168
<groupId>org.apache.maven.plugins</groupId>
@@ -196,7 +212,7 @@
196212
<dependency>
197213
<groupId>org.antlr</groupId>
198214
<artifactId>antlr-runtime</artifactId>
199-
<version>3.4</version>
215+
<version>${antlr.version}</version>
200216
</dependency>
201217

202218
<dependency>

0 commit comments

Comments
 (0)