Skip to content

Commit b10b8d8

Browse files
committed
Add debug output to AbstractAjcCompiler::isBuildNeeded
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.
1 parent 5646873 commit b10b8d8

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java

+17-2
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,24 @@ private void addModulesArgument(final String argument, final List<String> argume
828828
protected boolean isBuildNeeded()
829829
throws MojoExecutionException {
830830
File outDir = getArgumentFileDirectory();
831-
return hasNoPreviousBuild(outDir) || hasArgumentsChanged(outDir) ||
832-
hasSourcesChanged(outDir) || hasNonWeavedClassesChanged(outDir);
833831

832+
final boolean hasNoPreviousBuild = hasNoPreviousBuild(outDir);
833+
final boolean hasArgumentsChanged = hasArgumentsChanged(outDir);
834+
final boolean hasSourcesChanged = hasSourcesChanged(outDir);
835+
final boolean hasNonWeavedClassesChanged = hasNonWeavedClassesChanged(outDir);
836+
837+
final boolean isBuildNeeded = hasNoPreviousBuild || hasArgumentsChanged ||
838+
hasSourcesChanged || hasNonWeavedClassesChanged;
839+
840+
getLog().debug(
841+
"isBuildNeeded: " + isBuildNeeded + "(" +
842+
"hasNoPreviousBuild: " + hasNoPreviousBuild + ", " +
843+
"hasArgumentsChanged: " + hasArgumentsChanged + ", " +
844+
"hasSourcesChanged: " + hasSourcesChanged + ", " +
845+
"hasNonWeavedClassesChanged: " + hasNonWeavedClassesChanged + ")"
846+
);
847+
848+
return isBuildNeeded;
834849
}
835850

836851
private boolean hasNoPreviousBuild(File outDir) {

0 commit comments

Comments
 (0)