Skip to content

Commit

Permalink
Attempt to fix Windows build error
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Mar 20, 2024
1 parent 66dc3ed commit 0c0fa1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private Map<String, Object> createContentSource() {
Path playbookPath = getOutputFile().get().getAsFile().toPath().getParent();
Path antoraSrc = getProjectPath(getProject()).resolve(ANTORA_SOURCE_DIR);
StringBuilder url = new StringBuilder(".");
relativizeFromRootProject(playbookPath).normalize().forEach((path) -> url.append("/.."));
relativizeFromRootProject(playbookPath).normalize().forEach((path) -> url.append(File.separator).append(".."));
source.put("url", url.toString());
source.put("branches", "HEAD");
source.put("version", getProject().getVersion().toString());
Expand All @@ -159,7 +159,7 @@ private void addAntoraContentStartPaths(Set<String> startPaths) {
private void addDir(Map<String, Object> data) {
Path playbookDir = toRealPath(getOutputFile().get().getAsFile().toPath()).getParent();
Path outputDir = toRealPath(getProject().getBuildDir().toPath().resolve("site"));
data.put("output", Map.of("dir", "./" + playbookDir.relativize(outputDir).toString()));
data.put("output", Map.of("dir", "." + File.separator + playbookDir.relativize(outputDir).toString()));
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ void writePlaybookGeneratesExpectedContent() throws Exception {
task.getXrefStubs().addAll("appendix:.*", "api:.*", "reference:.*");
task.getAlwaysInclude().set(Map.of("name", "test", "classifier", "local-aggregate-content"));
});
Path actual = this.temp.toPath()
.resolve("rootproject/project/build/generated/docs/antora-playbook/antora-playbook.yml");
System.out.println(Files.readString(actual));
assertThat(actual).hasSameTextualContentAs(
Path.of("src/test/resources/org/springframework/boot/build/antora/expected-playbook.yml"));
String actual = Files.readString(this.temp.toPath()
.resolve("rootproject/project/build/generated/docs/antora-playbook/antora-playbook.yml"));
String expected = Files
.readString(Path.of("src/test/resources/org/springframework/boot/build/antora/expected-playbook.yml"));
System.out.println(actual);
assertThat(actual).isEqualToNormalizingNewlines(expected);
}

private void writePlaybookYml(ThrowingConsumer<GenerateAntoraPlaybook> customizer) throws Exception {
Expand Down

0 comments on commit 0c0fa1b

Please sign in to comment.