提交 b3aebf9e 编写于 作者: B Brian Clozel

Download docs resources as zip file in asciidoc build

Prior to this commit, the reference documentation build with asciidoctor
would get the common "spring-docs-resources" as a dependency and then
use it when generating the docs.

As seen in #23124, this can cause problems since we'd like to
consistently resolve our dependencies. In this case, the
"spring-doc-resources" archive is not published on maven central since
it's not officially supported by the Spring team as an open source
project.

This commit updates the reference documentation build to get this
archive as a simple download task and avoid resolving it as a
dependency.

See gh-23282
上级 5053df55
buildscript {
repositories {
maven { url "https://repo.spring.io/plugins-release" }
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath("io.spring.nohttp:nohttp-gradle:0.0.3.RELEASE")
classpath("org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16")
classpath("io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE")
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
classpath 'io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE'
}
}
// 3rd party plugin repositories can be configured in settings.gradle
plugins {
id 'org.springframework.build.test-sources' apply false
id "io.spring.dependency-management" version "1.0.7.RELEASE" apply false
id "org.jetbrains.kotlin.jvm" version "1.3.41" apply false
id "org.jetbrains.dokka" version "0.9.18" apply false
id "org.asciidoctor.convert" version "1.5.8"
id 'io.spring.dependency-management' version '1.0.7.RELEASE' apply false
id 'org.jetbrains.kotlin.jvm' version '1.3.41' apply false
id 'org.jetbrains.dokka' version '0.9.18' apply false
id 'org.asciidoctor.convert' version '1.5.8'
id 'io.spring.nohttp' version '0.0.3.RELEASE'
id 'de.undercouch.download' version '4.0.0'
}
ext {
......
......@@ -79,22 +79,16 @@ dokka {
}
}
configurations {
docs
task downloadResources(type: Download) {
def version = "0.1.2.RELEASE"
src "https://repo.spring.io/release/io/spring/docresources/" +
"spring-doc-resources/$version/spring-doc-resources-${version}.zip"
dest project.file("$buildDir/docs/spring-doc-resources.zip")
}
dependencies {
// for documentation resources
docs "io.spring.docresources:spring-doc-resources:0.1.0.RELEASE@zip"
}
task extractDocResources(type: Sync) {
dependsOn configurations.docs
from {
configurations.docs.collect { zipTree(it) }
}
from "src/docs/asciidoc/"
into "$buildDir/asciidoc/build"
task extractDocResources(type: Copy, dependsOn: downloadResources) {
from project.zipTree(downloadResources.dest);
into "$buildDir/docs/spring-docs-resources/"
}
/**
......@@ -102,14 +96,15 @@ task extractDocResources(type: Sync) {
* from "src/docs/asciidoc" into "build/asciidoc/html5"
*/
asciidoctor {
sourceDir "$buildDir/asciidoc/build"
sources {
include '*.adoc'
}
outputDir "$buildDir/docs/ref-docs/"
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
from "$buildDir/docs/spring-docs-resources/"
}
logDocuments = true
backends = ["html5"]
......@@ -121,10 +116,10 @@ asciidoctor {
attributes 'icons': 'font',
'idprefix': '',
'idseparator': '-',
docinfo: 'shared',
revnumber: project.version,
sectanchors: '',
sectnums: '',
'docinfo': 'shared',
'revnumber': project.version,
'sectanchors': '',
'sectnums': '',
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=atom-one-dark-reasonable',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册