You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/07/22 04:35:39 UTC

[GitHub] [maven-compiler-plugin] olamy commented on a diff in pull request #129: [MCOMPILER-499] Display recompilation causes

olamy commented on code in PR #129:
URL: https://github.com/apache/maven-compiler-plugin/pull/129#discussion_r927281110


##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -1909,6 +1949,52 @@ private String getMavenCompilerPluginVersion()
         return pomProperties.getProperty( "version" );
     }
 
+    private DirectoryScanResult computeInputFileTreeChanges( IncrementalBuildHelper ibh, Set<File> inputFiles )
+            throws MojoExecutionException
+    {
+        File mojoConfigBase = ibh.getMojoStatusDirectory();
+        File mojoConfigFile = new File( mojoConfigBase, INPUT_FILES_LST_FILENAME );
+
+        String[] oldInputFiles = new String[0];
+
+        if ( mojoConfigFile.exists() )
+        {
+            try
+            {
+                oldInputFiles = FileUtils.fileReadArray( mojoConfigFile );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException( "Error reading old mojo status " + mojoConfigFile, e );
+            }
+        }
+
+        String[] inputFileNames = new String[ inputFiles.size() ];

Review Comment:
   ```suggestion
   String[] inputFileNames = inputFiles.stream().map(file -> file.getAbsolutePath()).toArray(String[]::new);
   ```



##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -1515,7 +1541,14 @@ private boolean isSourceChanged( CompilerConfiguration compilerConfiguration, Co
         {
             for ( File f : staleSources )
             {
-                getLog().debug( "Stale source detected: " + f.getAbsolutePath() );
+                if ( showCompilationChanges )

Review Comment:
   we cannot see it in this GH ui diff but we go in this path only `if ( getLog().isDebugEnabled() )` this must be changed to something such 
   `if ( !staleSources.isEmpty() && (getLog().isDebugEnabled() ||  showCompilationChanges))`
   I guess the idea is to display those files when using `-Dmaven.compiler.showCompilationChanges=true` but without using full debug with `-X`
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org