Skip to content

Commit

Permalink
Remove use of destinationDir
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsromero committed Jun 15, 2023
1 parent db0d1d8 commit ce8383f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Improvements::
* Reimplement resource copy using 'plexus.util.DirectorScanner' instead of 'maven-filtering' to reduce dependencies and build time (#597)
* Set minimal Maven version to v3.8.5 (#629)
* Replace deprecated 'headerFooter' by 'standalone' in configuration (#649)
* Remove internal use of 'destinationDir' AsciidoctorJ method (no changes for users) (#650)

Build / Infrastructure::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,26 +286,26 @@ public File setDestinationPaths(final File sourceFile, final OptionsBuilder opti
if (configuration.isPreserveDirectories()) {
final String candidatePath = sourceFile.getParentFile().getCanonicalPath().substring(sourceDirectory.getCanonicalPath().length());
final File relativePath = new File(outputDir.getCanonicalPath() + candidatePath);
optionsBuilder.toDir(relativePath).destinationDir(relativePath);
optionsBuilder.toDir(relativePath);
} else {
optionsBuilder.toDir(outputDir).destinationDir(outputDir);
optionsBuilder.toDir(outputDir);
}
final File outputFile = configuration.getOutputFile();
final String destinationDir = (String) optionsBuilder.asMap().get(Options.DESTINATION_DIR);
final String toDir = (String) optionsBuilder.build().map().get(Options.TO_DIR);
if (outputFile != null) {
// allow overriding the output file name
optionsBuilder.toFile(outputFile);
return outputFile.isAbsolute() ? outputFile : new File(destinationDir, outputFile.getPath());
return outputFile.isAbsolute() ? outputFile : new File(toDir, outputFile.getPath());
} else {
return new File(destinationDir, sourceFile.getName());
return new File(toDir, sourceFile.getName());
}
} catch (IOException e) {
throw new MojoExecutionException("Unable to locate output directory", e);
}
}

protected Asciidoctor getAsciidoctorInstance(String gemPath) throws MojoExecutionException {
Asciidoctor asciidoctor = null;
Asciidoctor asciidoctor;
if (gemPath == null) {
asciidoctor = AsciidoctorJRuby.Factory.create();
} else {
Expand Down

0 comments on commit ce8383f

Please sign in to comment.