|
25 | 25 | import java.util.LinkedHashMap; |
26 | 26 | import java.util.List; |
27 | 27 | import java.util.Map; |
| 28 | +import java.util.TreeMap; |
28 | 29 |
|
29 | 30 | import com.fasterxml.jackson.databind.ObjectMapper; |
30 | 31 | import com.github.gradle.node.NodeExtension; |
@@ -87,7 +88,6 @@ public void apply(Project target) { |
87 | 88 | target.getLayout().getBuildDirectory().file("generated/docs/antora-yml/antora.yml")); |
88 | 89 | task.setProperty("yml", getDefaultYml(target)); |
89 | 90 | task.getAsciidocAttributes().putAll(getAsciidocAttributes(target)); |
90 | | - |
91 | 91 | }); |
92 | 92 | tasks.withType(AntoraTask.class, (antoraTask) -> { |
93 | 93 | antoraTask.setGroup("Documentation"); |
@@ -130,16 +130,17 @@ public void apply(Project target) { |
130 | 130 | private Provider<Map<String, String>> getAsciidocAttributes(Project project) { |
131 | 131 | return project.provider(() -> { |
132 | 132 | String version = project.getVersion().toString(); |
133 | | - return Map.of( // |
134 | | - "branch-or-tag", version.toString().endsWith("SNAPSHOT") ? "main" : "v$%s".formatted(version), // |
135 | | - "github", "https://github.com/spring-projects/spring-restdocs", // |
136 | | - "include-java", "ROOT:example$java/org/springframework/restdocs/docs", // |
137 | | - "project-version", version.toString(), // |
138 | | - "samples", "https://github.com/spring-projects/spring-restdocs-samples/tree/main", // |
139 | | - "source", "https://github.com/spring-projects/spring-restdocs/tree/{branch-or-tag}", // |
140 | | - "spring-boot-docs", "https://docs.spring.io/spring-boot/reference", // |
141 | | - "spring-framework-api", "https://docs.spring.io/spring-framework/docs/7.0.0/javadoc-api", // |
142 | | - "spring-framework-docs", "https://docs.spring.io/spring-framework/reference"); |
| 133 | + Map<String, String> attributes = new LinkedHashMap<>(); |
| 134 | + attributes.put("branch-or-tag", version.toString().endsWith("SNAPSHOT") ? "main" : "v$%s".formatted(version)); |
| 135 | + attributes.put("github", "https://github.com/spring-projects/spring-restdocs"); |
| 136 | + attributes.put("include-java", "ROOT:example$java/org/springframework/restdocs/docs"); |
| 137 | + attributes.put("project-version", version.toString()); |
| 138 | + attributes.put("samples", "https://github.com/spring-projects/spring-restdocs-samples/tree/main"); |
| 139 | + attributes.put("source", "https://github.com/spring-projects/spring-restdocs/tree/{branch-or-tag}"); |
| 140 | + attributes.put("spring-boot-docs", "https://docs.spring.io/spring-boot/reference"); |
| 141 | + attributes.put("spring-framework-api", "https://docs.spring.io/spring-framework/docs/7.0.0/javadoc-api"); |
| 142 | + attributes.put("spring-framework-docs", "https://docs.spring.io/spring-framework/reference"); |
| 143 | + return attributes; |
143 | 144 | }); |
144 | 145 | } |
145 | 146 |
|
|
0 commit comments