stefan-paal-innoq commented on a change in pull request #34:
URL:
https://github.com/apache/maven-checkstyle-plugin/pull/34#discussion_r479736853
##########
File path:
src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
##########
@@ -780,6 +770,53 @@ private void generateMainReport( CheckstyleResults
results, ResourceBundle bundl
generator.generateReport( results );
}
+ private void initializeXrefLocation( CheckstyleReportGenerator generator )
+ {
+ String relativePath = determineRelativePath( xrefLocation );
+ if ( xrefLocation.exists() || checkMavenJxrPluginIsConfigured() )
+ {
+ // XRef was already generated by manual execution of a lifecycle
binding
+ // the report is on its way
+ generator.setXrefLocation( relativePath );
+ }
+ }
+
+ private void initializeXrefTestLocation( CheckstyleReportGenerator
generator )
+ {
+ String relativePath = determineRelativePath( xrefTestLocation );
+ if ( xrefTestLocation.exists() || checkMavenJxrPluginIsConfigured() )
+ {
+ // XRef was already generated by manual execution of a lifecycle
binding
+ // the report is on its way
+ generator.setXrefTestLocation( relativePath );
+ }
+ }
+
+ private String determineRelativePath( File location )
+ {
+ String relativePath = PathTool.getRelativePath( getOutputDirectory(),
location.getAbsolutePath() );
+ if ( StringUtils.isEmpty( relativePath ) )
Review comment:
i use the `StringUtils` class which is already used in the class, hence
`org.codehaus.plexus.util.StringUtils`. should we use something different here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]