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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public class Antlr4Mojo extends AbstractMojo {
@Parameter(property = "antlr4.forceATN", defaultValue = "false")
protected boolean forceATN;

/**
* Skip grammar file change detect and just compile them.
*/
@Parameter(property = "antlr4.forceCompile", defaultValue = "false")
protected boolean forceCompile;

/**
* A list of grammar options to explicitly specify to the tool. These
* options are passed to the tool using the
Expand Down Expand Up @@ -394,7 +400,7 @@ private List<List<String>> processGrammarFiles(
for (File grammarFile : grammarFiles) {
String tokensFileName = grammarFile.getName().split("\\.")[0] + ".tokens";
File outputFile = new File(outputDirectory, tokensFileName);
if ( (! outputFile.exists()) ||
if (forceCompile || (! outputFile.exists()) ||
outputFile.lastModified() <= grammarFile.lastModified() ||
dependencies.isDependencyChanged(grammarFile)) {
grammarFilesToProcess.add(grammarFile);
Expand Down
Loading