Skip to content

Commit

Permalink
Fix baseDir pathing in site converter
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsromero committed Oct 6, 2024
1 parent b8bb3d2 commit a8dca2d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/main[co
Build / Infrastructure::

* Fix javadoc check flake in CI (#814)
* Bump AsciidoctorJ to v3.0.0 (#651)

== v3.0.0 (2024-01-30)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected OptionsBuilder defaultOptions(File siteDirectory) {
return Options.builder()
.backend("xhtml")
.safe(SafeMode.UNSAFE)
.baseDir(new File(siteDirectory, ROLE_HINT));
.baseDir(new File(siteDirectory, ROLE_HINT).getAbsoluteFile());
}

protected AttributesBuilder defaultAttributes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ public SiteConversionConfiguration processAsciiDocConfig(Xpp3Dom siteConfig,

private File resolveProjectDir(MavenProject project, String path) {
final File filePath = new File(path);
return !filePath.isAbsolute() ? new File(project.getBasedir(), filePath.toString()) : filePath;
return !filePath.isAbsolute() ? new File(project.getBasedir(), filePath.toString()).getAbsoluteFile() : filePath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,9 @@ void should_convert_to_html_with_a_preprocessor() throws MojoFailureException, M
mojo.resources = excludeAll();
mojo.outputDirectory = outputDir;
mojo.standalone = true;
// mojo.extensions = Arrays.asList(extensionConfiguration(ChangeAttributeValuePreprocessor.class));
mojo.extensions = Arrays.asList(extensionConfiguration(ChangeAttributeValuePreprocessor.class));
mojo.execute();
// then
String absolutePath = outputDir.getAbsolutePath();
AsciidoctorAsserter.assertThat(outputDir, "processors-sample.html")
.isNotEmpty()
.containsPattern("(" + ChangeAttributeValuePreprocessor.AUTHOR_NAME + "([\\s\\S])*){2}");
Expand Down

0 comments on commit a8dca2d

Please sign in to comment.