Skip to content

Commit

Permalink
Add debug output to AbstractAjcCompiler::isBuildNeeded
Browse files Browse the repository at this point in the history
While analysing and fixing mojohaus/aspectj-maven-plugin#15, it was
helpful to know the value of each of the 4 conditions determining the
method's return value.
  • Loading branch information
kriegaex committed Feb 11, 2024
1 parent 5646873 commit b10b8d8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,24 @@ private void addModulesArgument(final String argument, final List<String> argume
protected boolean isBuildNeeded()
throws MojoExecutionException {
File outDir = getArgumentFileDirectory();
return hasNoPreviousBuild(outDir) || hasArgumentsChanged(outDir) ||
hasSourcesChanged(outDir) || hasNonWeavedClassesChanged(outDir);

final boolean hasNoPreviousBuild = hasNoPreviousBuild(outDir);
final boolean hasArgumentsChanged = hasArgumentsChanged(outDir);
final boolean hasSourcesChanged = hasSourcesChanged(outDir);
final boolean hasNonWeavedClassesChanged = hasNonWeavedClassesChanged(outDir);

final boolean isBuildNeeded = hasNoPreviousBuild || hasArgumentsChanged ||
hasSourcesChanged || hasNonWeavedClassesChanged;

getLog().debug(
"isBuildNeeded: " + isBuildNeeded + "(" +
"hasNoPreviousBuild: " + hasNoPreviousBuild + ", " +
"hasArgumentsChanged: " + hasArgumentsChanged + ", " +
"hasSourcesChanged: " + hasSourcesChanged + ", " +
"hasNonWeavedClassesChanged: " + hasNonWeavedClassesChanged + ")"
);

return isBuildNeeded;
}

private boolean hasNoPreviousBuild(File outDir) {
Expand Down

0 comments on commit b10b8d8

Please sign in to comment.