Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maven]Add a Force Compile Property #4618

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

georgecao
Copy link

When I upgrade antlr to a new version, but keep the grammar files untouched, the grammar files will not be compiled but there is a warning message complaining the runtime version changed.

So I add a property forceCompile to skip the checksum and last modification date check and just re-compile the grammars.

@georgecao georgecao changed the title Add a Force Compile Property [Maven]Add a Force Compile Property May 17, 2024
@jimidle
Copy link
Collaborator

jimidle commented May 17, 2024 via email

@georgecao
Copy link
Author

georgecao commented May 23, 2024

I add the plugin as follow:

             <plugin>
                    <groupId>org.antlr</groupId>
                    <artifactId>antlr4-maven-plugin</artifactId>
                    <version>4.13.1</version>
                </plugin>

and I tested mvn clean compile, but the grammar files were not re-compiled.
I read the code, beside the modification date of the grammar file, the plugin also check *.tokens files. I can force the re-compile by deleting the *.tokens files then run mvn clean compile.

@jimidle
Copy link
Collaborator

jimidle commented May 23, 2024

Your configuration is wrong I think.

...
<executions>
 <execution>
  <goals>
   <goal>antlr4</goal>
  </goals>
 </execution>
</executions>
<configuration>
  <visitor>true</visitor>
  <sourceDirectory>src/main/antlr4</sourceDirectory>
</configuration>  

If your configuration is correct then check permissions and file times. There is no need for this flag.

@khmarbaise
Copy link
Contributor

I'm using a usual configuration https://github.com/khmarbaise/rpn-calculator/blob/master/pom.xml and it work without any issue... no supplemental source directory configuration needed... just follow the convention... https://github.com/khmarbaise/rpn-calculator/blob/master/rpn/pom.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants