Skip to content

Commit

Permalink
Dynamically calculate javadocDir/testJavadocDir
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Nov 22, 2023
1 parent abafb39 commit 05ef78b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void createXref(Locale locale, String outputDirectory, List<String> sour
}

/**
* Returns the bottom text to be displayed at the lower part of the generated JXR reports.
* Returns the bottom text to be displayed at the lower part of the generated JXR report.
*/
private String getBottomText() {
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
Expand Down Expand Up @@ -523,10 +523,10 @@ private Path getJavadocLocation() throws IOException {
}

/**
* Abstract method that returns the plugin report output directory where the generated JXR reports will be put
* Abstract method that returns the plugin report output directory where the generated JXR report will be put
* beneath {@link #getReportOutputDirectory()}.
*
* @return a String that contains the target directory name
* @return a String that contains the target directory
*/
protected abstract String getPluginReportOutputDirectory();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public class JxrReport extends AbstractJxrReport {

/**
* Directory where Javadoc is generated for this project.
* <br>
* <strong>Default</strong>: {@link #getReportOutputDirectory()} + {@code /apidocs}
*/
@Parameter(defaultValue = "${project.reporting.outputDirectory}/apidocs")
@Parameter
private File javadocDir;

@Override
Expand Down Expand Up @@ -121,6 +123,6 @@ public String getOutputName() {

@Override
protected File getJavadocDir() {
return javadocDir;
return javadocDir != null ? javadocDir : new File(getReportOutputDirectory(), "apidocs");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ public class JxrTestReport extends AbstractJxrReport {

/**
* Directory where Test Javadoc is generated for this project.
* <br>
* <strong>Default</strong>: {@link #getReportOutputDirectory()} + {@code /testapidocs}
*/
@Parameter(defaultValue = "${project.reporting.outputDirectory}/testapidocs")
@Parameter
private File testJavadocDir;

@Override
Expand Down Expand Up @@ -103,6 +105,6 @@ public String getOutputName() {

@Override
protected File getJavadocDir() {
return testJavadocDir;
return testJavadocDir != null ? testJavadocDir : new File(getReportOutputDirectory(), "testapidocs");
}
}

0 comments on commit 05ef78b

Please sign in to comment.