Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 628c333

Browse filesBrowse files
authored
[MCOMPILER-549] Improve log message in case of recompilation (#201)
* idk refactored to immutableOutputFile * rephrased log output * reformatted code * improved log message * updated test case
1 parent d138bd4 commit 628c333
Copy full SHA for 628c333

File tree

Expand file treeCollapse file tree

2 files changed

+11
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-9
lines changed

‎src/it/MCOMPILER-500-package-info-incr/verify.groovy

Copy file name to clipboardExpand all lines: src/it/MCOMPILER-500-package-info-incr/verify.groovy
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def logFile = new File( basedir, 'build.log' )
2020
assert logFile.exists()
2121
content = logFile.text
2222

23-
assert 1 == content.count( 'Changes detected - recompiling the module!' )
24-
assert 1 == content.count( 'Nothing to compile - all classes are up to date' )
23+
assert 1 == content.count( "Recompiling the module because of ")
24+
assert 1 == content.count( 'Nothing to compile - all classes are up to date.' )
2525

2626

‎src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java

Copy file name to clipboardExpand all lines: src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -878,20 +878,22 @@ public void execute() throws MojoExecutionException, CompilationFailureException
878878

879879
DirectoryScanResult dsr = computeInputFileTreeChanges(incrementalBuildHelper, sources);
880880

881-
boolean idk = compiler.getCompilerOutputStyle()
881+
boolean immutableOutputFile = compiler.getCompilerOutputStyle()
882882
.equals(CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES)
883883
&& !canUpdateTarget;
884884
boolean dependencyChanged = isDependencyChanged();
885885
boolean sourceChanged = isSourceChanged(compilerConfiguration, compiler);
886886
boolean inputFileTreeChanged = hasInputFileTreeChanged(dsr);
887887
// CHECKSTYLE_OFF: LineLength
888-
if (idk || dependencyChanged || sourceChanged || inputFileTreeChanged)
888+
if (immutableOutputFile || dependencyChanged || sourceChanged || inputFileTreeChanged)
889889
// CHECKSTYLE_ON: LineLength
890890
{
891-
String cause = idk
892-
? "idk"
893-
: (dependencyChanged ? "dependency" : (sourceChanged ? "source" : "input tree"));
894-
getLog().info("Changes detected - recompiling the module! :" + cause);
891+
String cause = immutableOutputFile
892+
? "immutable single output file"
893+
: (dependencyChanged
894+
? "changed dependency"
895+
: (sourceChanged ? "changed source code" : "added or removed source files"));
896+
getLog().info("Recompiling the module because of " + cause + ".");
895897
if (showCompilationChanges) {
896898
for (String fileAdded : dsr.getFilesAdded()) {
897899
getLog().info("\t+ " + fileAdded);
@@ -903,7 +905,7 @@ public void execute() throws MojoExecutionException, CompilationFailureException
903905

904906
compilerConfiguration.setSourceFiles(sources);
905907
} else {
906-
getLog().info("Nothing to compile - all classes are up to date");
908+
getLog().info("Nothing to compile - all classes are up to date.");
907909

908910
return;
909911
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.