commit
ba87aca05e
|
@ -77,7 +77,7 @@ public class AntoraAsciidocAttributes {
|
||||||
Map<String, String> attributes = new LinkedHashMap<>();
|
Map<String, String> attributes = new LinkedHashMap<>();
|
||||||
addGitHubAttributes(attributes);
|
addGitHubAttributes(attributes);
|
||||||
addVersionAttributes(attributes);
|
addVersionAttributes(attributes);
|
||||||
addUrlArtifactRepository(attributes);
|
addArtifactAttributes(attributes);
|
||||||
addUrlJava(attributes);
|
addUrlJava(attributes);
|
||||||
addUrlLibraryLinkAttributes(attributes);
|
addUrlLibraryLinkAttributes(attributes);
|
||||||
addPropertyAttributes(attributes);
|
addPropertyAttributes(attributes);
|
||||||
|
@ -139,8 +139,9 @@ public class AntoraAsciidocAttributes {
|
||||||
attributes.put("version-" + name, version);
|
attributes.put("version-" + name, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUrlArtifactRepository(Map<String, String> attributes) {
|
private void addArtifactAttributes(Map<String, String> attributes) {
|
||||||
attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo());
|
attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo());
|
||||||
|
attributes.put("artifact-release-type", this.artifactRelease.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUrlJava(Map<String, String> attributes) {
|
private void addUrlJava(Map<String, String> attributes) {
|
||||||
|
|
|
@ -112,6 +112,27 @@ class AntoraAsciidocAttributesTests {
|
||||||
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot");
|
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void artifactReleaseTypeWhenRelease() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
||||||
|
mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "release");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void artifactReleaseTypeWhenMilestone() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null,
|
||||||
|
mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void artifactReleaseTypeWhenSnapshot() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null,
|
||||||
|
mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void urlLinksFromLibrary() {
|
void urlLinksFromLibrary() {
|
||||||
Map<String, Function<LibraryVersion, String>> links = new LinkedHashMap<>();
|
Map<String, Function<LibraryVersion, String>> links = new LinkedHashMap<>();
|
||||||
|
|
Loading…
Reference in New Issue