|
318 | 318 | </executions>
|
319 | 319 | </plugin>
|
320 | 320 |
|
| 321 | + <plugin> |
| 322 | + <groupId>org.codehaus.mojo</groupId> |
| 323 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 324 | + <executions> |
| 325 | + <!-- |
| 326 | + To understand what this plugin execution does, please read |
| 327 | + https://www.mojohaus.org/build-helper-maven-plugin/usage.html#set-a-property-according-to-whether-target-files-are-up-to-date |
| 328 | + --> |
| 329 | + <execution> |
| 330 | + <id>set-antlr4-directory</id> |
| 331 | + <goals> |
| 332 | + <goal>uptodate-property</goal> |
| 333 | + </goals> |
| 334 | + <!-- Repeat default phase for clarity --> |
| 335 | + <phase>validate</phase> |
| 336 | + <configuration> |
| 337 | + <name>antlr4.dir</name> |
| 338 | + <value>antlr4-dummy</value> |
| 339 | + <else>antlr4</else> |
| 340 | + <fileSet> |
| 341 | + <directory>${project.basedir}/src/main/antlr4</directory> |
| 342 | + <outputDirectory>${project.build.directory}/generated-sources/antlr4</outputDirectory> |
| 343 | + <mapper> |
| 344 | + <type>glob</type> |
| 345 | + <from>*.g4</from> |
| 346 | + <to>*.interp</to> |
| 347 | + </mapper> |
| 348 | + </fileSet> |
| 349 | + </configuration> |
| 350 | + </execution> |
| 351 | + </executions> |
| 352 | + </plugin> |
| 353 | + |
321 | 354 | <plugin>
|
322 | 355 | <groupId>org.antlr</groupId>
|
323 | 356 | <artifactId>antlr4-maven-plugin</artifactId>
|
|
330 | 363 | <phase>generate-sources</phase>
|
331 | 364 | <configuration>
|
332 | 365 | <visitor>true</visitor>
|
333 |
| - <sourceDirectory>${project.basedir}/src/main/antlr4</sourceDirectory> |
| 366 | + <!-- Set source dir explicitly, either to default or to dummy value, the latter yielding 0 hits --> |
| 367 | + <sourceDirectory>${project.basedir}/src/main/${antlr4.dir}</sourceDirectory> |
334 | 368 | </configuration>
|
335 | 369 | </execution>
|
336 | 370 | </executions>
|
337 | 371 | </plugin>
|
338 | 372 |
|
339 | 373 | <plugin>
|
340 | 374 | <groupId>com.google.code.maven-replacer-plugin</groupId>
|
341 |
| - <artifactId>maven-replacer-plugin</artifactId> |
342 |
| - <version>1.4.1</version> |
| 375 | + <artifactId>replacer</artifactId> |
| 376 | + <version>1.5.3</version> |
343 | 377 | <executions>
|
344 | 378 | <execution>
|
345 | 379 | <phase>process-sources</phase>
|
|
349 | 383 | <configuration>
|
350 | 384 | <basedir>${project.build.directory}/generated-sources</basedir>
|
351 | 385 | <includes>
|
352 |
| - <include>antlr4/**/*.java</include> |
| 386 | + <!-- Replace tokens in real or dummy directory, the latter yielding 0 hits --> |
| 387 | + <include>${antlr4.dir}/**/*.java</include> |
353 | 388 | </includes>
|
354 | 389 | <variableTokenValueMap>
|
355 | 390 | public class=class,public interface=interface
|
|
0 commit comments