"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java" between
spring-boot-2.7.3.tar.gz and spring-boot-2.7.4.tar.gz

About: Spring Boot helps to create Spring-powered, production-grade applications and services.

AsciidoctorConventions.java  (spring-boot-2.7.3):AsciidoctorConventions.java  (spring-boot-2.7.4)
skipping to change at line 29 skipping to change at line 29
import java.io.File; import java.io.File;
import java.net.URI; 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;
import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask; import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask;
import org.asciidoctor.gradle.jvm.AsciidoctorJExtension; import org.asciidoctor.gradle.jvm.AsciidoctorJExtension;
import org.asciidoctor.gradle.jvm.AsciidoctorJPlugin; import org.asciidoctor.gradle.jvm.AsciidoctorJPlugin;
import org.asciidoctor.gradle.jvm.AsciidoctorTask; import org.asciidoctor.gradle.jvm.AsciidoctorTask;
import org.gradle.api.JavaVersion;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.Sync; import org.gradle.api.tasks.Sync;
import org.springframework.boot.build.artifactory.ArtifactoryRepository; import org.springframework.boot.build.artifactory.ArtifactoryRepository;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
* Conventions that are applied in the presence of the {@link AsciidoctorJPlugin }. When * Conventions that are applied in the presence of the {@link AsciidoctorJPlugin }. When
* the plugin is applied: * the plugin is applied:
skipping to change at line 121 skipping to change at line 122
.create("io.spring.asciidoctor.backends:s pring-asciidoctor-backends:0.0.3")); .create("io.spring.asciidoctor.backends:s pring-asciidoctor-backends:0.0.3"));
configuration.getDependencies() configuration.getDependencies()
.add(project.getDependencies().create("or g.asciidoctor:asciidoctorj-pdf:1.5.3")); .add(project.getDependencies().create("or g.asciidoctor:asciidoctorj-pdf:1.5.3"));
}); });
} }
private void configureAsciidoctorTask(Project project, AbstractAsciidocto rTask asciidoctorTask) { private void configureAsciidoctorTask(Project project, AbstractAsciidocto rTask asciidoctorTask) {
asciidoctorTask.configurations(EXTENSIONS_CONFIGURATION_NAME); asciidoctorTask.configurations(EXTENSIONS_CONFIGURATION_NAME);
configureCommonAttributes(project, asciidoctorTask); configureCommonAttributes(project, asciidoctorTask);
configureOptions(asciidoctorTask); configureOptions(asciidoctorTask);
configureForkOptions(asciidoctorTask);
asciidoctorTask.baseDirFollowsSourceDir(); asciidoctorTask.baseDirFollowsSourceDir();
createSyncDocumentationSourceTask(project, asciidoctorTask); createSyncDocumentationSourceTask(project, asciidoctorTask);
if (asciidoctorTask instanceof AsciidoctorTask) { if (asciidoctorTask instanceof AsciidoctorTask) {
boolean pdf = asciidoctorTask.getName().toLowerCase().con tains("pdf"); boolean pdf = asciidoctorTask.getName().toLowerCase().con tains("pdf");
String backend = (!pdf) ? "spring-html" : "spring-pdf"; String backend = (!pdf) ? "spring-html" : "spring-pdf";
((AsciidoctorTask) asciidoctorTask).outputOptions((output Options) -> outputOptions.backends(backend)); ((AsciidoctorTask) asciidoctorTask).outputOptions((output Options) -> outputOptions.backends(backend));
} }
} }
private void configureCommonAttributes(Project project, AbstractAsciidoct orTask asciidoctorTask) { private void configureCommonAttributes(Project project, AbstractAsciidoct orTask asciidoctorTask) {
Map<String, Object> attributes = new HashMap<>(); Map<String, Object> attributes = new HashMap<>();
attributes.put("attribute-missing", "warn"); attributes.put("attribute-missing", "warn");
attributes.put("github-tag", determineGitHubTag(project)); attributes.put("github-tag", determineGitHubTag(project));
attributes.put("spring-boot-artifactory-repo", ArtifactoryReposit ory.forProject(project)); attributes.put("spring-boot-artifactory-repo", ArtifactoryReposit ory.forProject(project));
attributes.put("revnumber", null); attributes.put("revnumber", null);
asciidoctorTask.attributes(attributes); asciidoctorTask.attributes(attributes);
} }
// See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/59
7
private void configureForkOptions(AbstractAsciidoctorTask asciidoctorTask
) {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16
)) {
asciidoctorTask.forkOptions((options) -> options.jvmArgs(
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens", "java.base/java.io=ALL-UNN
AMED"));
}
}
private String determineGitHubTag(Project project) { private String determineGitHubTag(Project project) {
String version = "v" + project.getVersion(); String version = "v" + project.getVersion();
return (version.endsWith("-SNAPSHOT")) ? "2.7.x" : version; return (version.endsWith("-SNAPSHOT")) ? "2.7.x" : version;
} }
private void configureOptions(AbstractAsciidoctorTask asciidoctorTask) { private void configureOptions(AbstractAsciidoctorTask asciidoctorTask) {
asciidoctorTask.options(Collections.singletonMap("doctype", "book ")); asciidoctorTask.options(Collections.singletonMap("doctype", "book "));
} }
private Sync createSyncDocumentationSourceTask(Project project, AbstractA sciidoctorTask asciidoctorTask) { private Sync createSyncDocumentationSourceTask(Project project, AbstractA sciidoctorTask asciidoctorTask) {
 End of changes. 3 change blocks. 
0 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)