|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2022 the original author or authors.
|
|
|
|
|
* Copyright 2012-2023 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -17,7 +17,6 @@
|
|
|
|
|
package org.springframework.boot.build;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.net.URI;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -39,13 +38,6 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
* the plugin is applied:
|
|
|
|
|
*
|
|
|
|
|
* <ul>
|
|
|
|
|
* <li>The {@code https://repo.spring.io/release} Maven repository is configured and
|
|
|
|
|
* limited to dependencies in the following groups:
|
|
|
|
|
* <ul>
|
|
|
|
|
* <li>{@code io.spring.asciidoctor}
|
|
|
|
|
* <li>{@code io.spring.asciidoctor.backends}
|
|
|
|
|
* <li>{@code io.spring.docresources}
|
|
|
|
|
* </ul>
|
|
|
|
|
* <li>All warnings are made fatal.
|
|
|
|
|
* <li>The version of AsciidoctorJ is upgraded to 2.4.3.
|
|
|
|
|
* <li>An {@code asciidoctorExtensions} configuration is created.
|
|
|
|
@ -76,7 +68,6 @@ class AsciidoctorConventions {
|
|
|
|
|
|
|
|
|
|
void apply(Project project) {
|
|
|
|
|
project.getPlugins().withType(AsciidoctorJPlugin.class, (asciidoctorPlugin) -> {
|
|
|
|
|
configureDocumentationDependenciesRepository(project);
|
|
|
|
|
makeAllWarningsFatal(project);
|
|
|
|
|
upgradeAsciidoctorJVersion(project);
|
|
|
|
|
createAsciidoctorExtensionsConfiguration(project);
|
|
|
|
@ -85,17 +76,6 @@ class AsciidoctorConventions {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void configureDocumentationDependenciesRepository(Project project) {
|
|
|
|
|
project.getRepositories().maven((mavenRepo) -> {
|
|
|
|
|
mavenRepo.setUrl(URI.create("https://repo.spring.io/release"));
|
|
|
|
|
mavenRepo.mavenContent((mavenContent) -> {
|
|
|
|
|
mavenContent.includeGroup("io.spring.asciidoctor");
|
|
|
|
|
mavenContent.includeGroup("io.spring.asciidoctor.backends");
|
|
|
|
|
mavenContent.includeGroup("io.spring.docresources");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void makeAllWarningsFatal(Project project) {
|
|
|
|
|
project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(".*");
|
|
|
|
|
}
|
|
|
|
@ -109,7 +89,7 @@ class AsciidoctorConventions {
|
|
|
|
|
project.getConfigurations().matching((candidate) -> "dependencyManagement".equals(candidate.getName()))
|
|
|
|
|
.all(configuration::extendsFrom);
|
|
|
|
|
configuration.getDependencies().add(project.getDependencies()
|
|
|
|
|
.create("io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.3"));
|
|
|
|
|
.create("io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.4"));
|
|
|
|
|
configuration.getDependencies()
|
|
|
|
|
.add(project.getDependencies().create("org.asciidoctor:asciidoctorj-pdf:1.5.3"));
|
|
|
|
|
});
|
|
|
|
|