mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Upgrade to Asciidoctor Backends 0.0.4
Closes gh-33761
This commit is contained in:
parent
809c220849
commit
a8da4e1004
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -17,7 +17,6 @@
|
|||||||
package org.springframework.boot.build;
|
package org.springframework.boot.build;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URI;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -39,13 +38,6 @@ import org.springframework.util.StringUtils;
|
|||||||
* the plugin is applied:
|
* the plugin is applied:
|
||||||
*
|
*
|
||||||
* <ul>
|
* <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>All warnings are made fatal.
|
||||||
* <li>The version of AsciidoctorJ is upgraded to 2.4.3.
|
* <li>The version of AsciidoctorJ is upgraded to 2.4.3.
|
||||||
* <li>An {@code asciidoctorExtensions} configuration is created.
|
* <li>An {@code asciidoctorExtensions} configuration is created.
|
||||||
@ -76,7 +68,6 @@ class AsciidoctorConventions {
|
|||||||
|
|
||||||
void apply(Project project) {
|
void apply(Project project) {
|
||||||
project.getPlugins().withType(AsciidoctorJPlugin.class, (asciidoctorPlugin) -> {
|
project.getPlugins().withType(AsciidoctorJPlugin.class, (asciidoctorPlugin) -> {
|
||||||
configureDocumentationDependenciesRepository(project);
|
|
||||||
makeAllWarningsFatal(project);
|
makeAllWarningsFatal(project);
|
||||||
upgradeAsciidoctorJVersion(project);
|
upgradeAsciidoctorJVersion(project);
|
||||||
createAsciidoctorExtensionsConfiguration(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) {
|
private void makeAllWarningsFatal(Project project) {
|
||||||
project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(".*");
|
project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(".*");
|
||||||
}
|
}
|
||||||
@ -109,7 +89,7 @@ class AsciidoctorConventions {
|
|||||||
project.getConfigurations().matching((candidate) -> "dependencyManagement".equals(candidate.getName()))
|
project.getConfigurations().matching((candidate) -> "dependencyManagement".equals(candidate.getName()))
|
||||||
.all(configuration::extendsFrom);
|
.all(configuration::extendsFrom);
|
||||||
configuration.getDependencies().add(project.getDependencies()
|
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()
|
configuration.getDependencies()
|
||||||
.add(project.getDependencies().create("org.asciidoctor:asciidoctorj-pdf:1.5.3"));
|
.add(project.getDependencies().create("org.asciidoctor:asciidoctorj-pdf:1.5.3"));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user