You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
253 lines
6.2 KiB
253 lines
6.2 KiB
2 years ago
|
description = "Spring Framework Docs"
|
||
|
|
||
|
apply plugin: 'kotlin'
|
||
|
apply plugin: 'org.asciidoctor.jvm.convert'
|
||
|
apply plugin: 'org.asciidoctor.jvm.pdf'
|
||
|
apply from: "${rootDir}/gradle/publications.gradle"
|
||
|
|
||
|
|
||
5 years ago
|
configurations {
|
||
2 years ago
|
asciidoctorExtensions
|
||
5 years ago
|
}
|
||
|
|
||
2 years ago
|
jar {
|
||
|
enabled = false
|
||
|
}
|
||
|
|
||
|
javadoc {
|
||
|
enabled = false
|
||
|
}
|
||
|
|
||
5 years ago
|
dependencies {
|
||
2 years ago
|
asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.3"
|
||
5 years ago
|
}
|
||
|
|
||
|
repositories {
|
||
|
maven {
|
||
|
url "https://repo.spring.io/release"
|
||
|
}
|
||
5 years ago
|
}
|
||
|
|
||
5 years ago
|
/**
|
||
|
* Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
|
||
8 years ago
|
*/
|
||
|
task api(type: Javadoc) {
|
||
|
group = "Documentation"
|
||
|
description = "Generates aggregated Javadoc API documentation."
|
||
|
title = "${rootProject.description} ${version} API"
|
||
|
|
||
|
dependsOn {
|
||
2 years ago
|
moduleProjects.collect {
|
||
8 years ago
|
it.tasks.getByName("jar")
|
||
|
}
|
||
|
}
|
||
|
doFirst {
|
||
|
classpath = files(
|
||
|
// ensure the javadoc process can resolve types compiled from .aj sources
|
||
|
project(":spring-aspects").sourceSets.main.output
|
||
|
)
|
||
2 years ago
|
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
|
||
5 years ago
|
}
|
||
|
|
||
|
options {
|
||
|
encoding = "UTF-8"
|
||
|
memberLevel = JavadocMemberLevel.PROTECTED
|
||
|
author = true
|
||
|
header = rootProject.description
|
||
|
use = true
|
||
2 years ago
|
overview = "framework-docs/src/docs/api/overview.html"
|
||
5 years ago
|
splitIndex = true
|
||
|
links(project.ext.javadocLinks)
|
||
3 years ago
|
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
|
||
3 years ago
|
addBooleanOption('Werror', true) // fail build on Javadoc warnings
|
||
8 years ago
|
}
|
||
2 years ago
|
source moduleProjects.collect { project ->
|
||
5 years ago
|
project.sourceSets.main.allJava
|
||
|
}
|
||
|
maxMemory = "1024m"
|
||
|
destinationDir = file("$buildDir/docs/javadoc")
|
||
8 years ago
|
}
|
||
|
|
||
5 years ago
|
/**
|
||
|
* Produce KDoc for all Spring Framework modules in "build/docs/kdoc"
|
||
|
*/
|
||
2 years ago
|
rootProject.tasks.dokkaHtmlMultiModule.configure {
|
||
|
dependsOn {
|
||
|
tasks.getByName("api")
|
||
7 years ago
|
}
|
||
2 years ago
|
moduleName.set("spring-framework")
|
||
|
outputDirectory.set(project.file("$buildDir/docs/kdoc"))
|
||
4 years ago
|
}
|
||
7 years ago
|
|
||
5 years ago
|
asciidoctorj {
|
||
3 years ago
|
def docRoot = 'https://docs.spring.io'
|
||
|
def docsSpringFramework = "${docRoot}/spring-framework/docs/${project.version}"
|
||
2 years ago
|
version = '2.4.3'
|
||
5 years ago
|
fatalWarnings ".*"
|
||
4 years ago
|
options doctype: 'book', eruby: 'erubis'
|
||
|
attributes([
|
||
|
icons: 'font',
|
||
|
idprefix: '',
|
||
|
idseparator: '-',
|
||
|
revnumber: project.version,
|
||
|
sectanchors: '',
|
||
|
sectnums: '',
|
||
3 years ago
|
'spring-version': project.version,
|
||
3 years ago
|
'spring-framework-main-code': 'https://github.com/spring-projects/spring-framework/tree/main',
|
||
|
'doc-root': docRoot,
|
||
|
'docs-spring-framework': docsSpringFramework,
|
||
|
'api-spring-framework': "${docsSpringFramework}/javadoc-api/org/springframework"
|
||
4 years ago
|
])
|
||
5 years ago
|
}
|
||
|
|
||
5 years ago
|
/**
|
||
2 years ago
|
* Generate the Spring Framework Reference documentation from
|
||
|
* "src/docs/asciidoc" in "build/docs/ref-docs/html5".
|
||
5 years ago
|
*/
|
||
7 years ago
|
asciidoctor {
|
||
5 years ago
|
baseDirFollowsSourceDir()
|
||
2 years ago
|
configurations "asciidoctorExtensions"
|
||
7 years ago
|
sources {
|
||
|
include '*.adoc'
|
||
|
}
|
||
4 years ago
|
outputDir "$buildDir/docs/ref-docs/html5"
|
||
2 years ago
|
outputOptions {
|
||
|
backends "spring-html"
|
||
|
}
|
||
4 years ago
|
logDocuments = true
|
||
7 years ago
|
resources {
|
||
|
from(sourceDir) {
|
||
2 years ago
|
include 'images/*.png'
|
||
7 years ago
|
}
|
||
|
}
|
||
4 years ago
|
}
|
||
|
|
||
|
/**
|
||
|
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
|
||
|
* in "build/docs/ref-docs/pdf".
|
||
|
*/
|
||
|
asciidoctorPdf {
|
||
|
baseDirFollowsSourceDir()
|
||
2 years ago
|
configurations 'asciidoctorExtensions'
|
||
4 years ago
|
sources {
|
||
|
include '*.adoc'
|
||
7 years ago
|
}
|
||
4 years ago
|
outputDir "$buildDir/docs/ref-docs/pdf"
|
||
2 years ago
|
forkOptions {
|
||
|
jvmArgs += ["--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"]
|
||
|
}
|
||
4 years ago
|
logDocuments = true
|
||
7 years ago
|
}
|
||
|
|
||
5 years ago
|
/**
|
||
|
* Zip all docs (API and reference) into a single archive
|
||
|
*/
|
||
2 years ago
|
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', rootProject.tasks.dokkaHtmlMultiModule]) {
|
||
8 years ago
|
group = "Distribution"
|
||
5 years ago
|
description = "Builds -${archiveClassifier} archive containing api and reference " +
|
||
2 years ago
|
"for deployment at https://docs.spring.io/spring-framework/docs/."
|
||
8 years ago
|
|
||
5 years ago
|
archiveBaseName.set("spring-framework")
|
||
|
archiveClassifier.set("docs")
|
||
8 years ago
|
from("src/dist") {
|
||
|
include "changelog.txt"
|
||
|
}
|
||
|
from (api) {
|
||
|
into "javadoc-api"
|
||
|
}
|
||
4 years ago
|
from ("$asciidoctor.outputDir") {
|
||
4 years ago
|
into "reference/html"
|
||
8 years ago
|
}
|
||
4 years ago
|
from ("$asciidoctorPdf.outputDir") {
|
||
4 years ago
|
into "reference/pdf"
|
||
7 years ago
|
}
|
||
2 years ago
|
from (rootProject.tasks.dokkaHtmlMultiModule.outputDirectory) {
|
||
7 years ago
|
into "kdoc-api"
|
||
|
}
|
||
8 years ago
|
}
|
||
|
|
||
5 years ago
|
/**
|
||
|
* Zip all Spring Framework schemas into a single archive
|
||
|
*/
|
||
8 years ago
|
task schemaZip(type: Zip) {
|
||
|
group = "Distribution"
|
||
5 years ago
|
archiveBaseName.set("spring-framework")
|
||
|
archiveClassifier.set("schema")
|
||
|
description = "Builds -${archiveClassifier} archive containing all " +
|
||
6 years ago
|
"XSDs for deployment at https://springframework.org/schema."
|
||
5 years ago
|
duplicatesStrategy DuplicatesStrategy.EXCLUDE
|
||
2 years ago
|
moduleProjects.each { module ->
|
||
8 years ago
|
def Properties schemas = new Properties();
|
||
|
|
||
5 years ago
|
module.sourceSets.main.resources.find {
|
||
5 years ago
|
(it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
|
||
8 years ago
|
}?.withInputStream { schemas.load(it) }
|
||
|
|
||
|
for (def key : schemas.keySet()) {
|
||
|
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
|
||
|
assert shortName != key
|
||
5 years ago
|
File xsdFile = module.sourceSets.main.resources.find {
|
||
5 years ago
|
(it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
|
||
8 years ago
|
}
|
||
|
assert xsdFile != null
|
||
|
into (shortName) {
|
||
|
from xsdFile.path
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
5 years ago
|
/**
|
||
|
* Create a distribution zip with everything:
|
||
|
* docs, schemas, jars, source jars, javadoc jars
|
||
|
*/
|
||
8 years ago
|
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
|
||
|
group = "Distribution"
|
||
5 years ago
|
archiveBaseName.set("spring-framework")
|
||
|
archiveClassifier.set("dist")
|
||
|
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
|
||
8 years ago
|
"suitable for community download page."
|
||
|
|
||
5 years ago
|
ext.baseDir = "spring-framework-${project.version}";
|
||
8 years ago
|
|
||
|
from("src/docs/dist") {
|
||
|
include "readme.txt"
|
||
|
include "license.txt"
|
||
|
include "notice.txt"
|
||
|
into "${baseDir}"
|
||
|
expand(copyright: new Date().format("yyyy"), version: project.version)
|
||
|
}
|
||
|
|
||
3 years ago
|
from(zipTree(docsZip.archiveFile)) {
|
||
8 years ago
|
into "${baseDir}/docs"
|
||
|
}
|
||
|
|
||
3 years ago
|
from(zipTree(schemaZip.archiveFile)) {
|
||
8 years ago
|
into "${baseDir}/schema"
|
||
|
}
|
||
|
|
||
2 years ago
|
moduleProjects.each { module ->
|
||
8 years ago
|
into ("${baseDir}/libs") {
|
||
5 years ago
|
from module.jar
|
||
|
if (module.tasks.findByPath("sourcesJar")) {
|
||
|
from module.sourcesJar
|
||
8 years ago
|
}
|
||
5 years ago
|
if (module.tasks.findByPath("javadocJar")) {
|
||
|
from module.javadocJar
|
||
8 years ago
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
2 years ago
|
distZip.mustRunAfter moduleProjects.check
|
||
2 years ago
|
|
||
|
|
||
|
publishing {
|
||
|
publications {
|
||
|
mavenJava(MavenPublication) {
|
||
|
artifact docsZip
|
||
|
artifact schemaZip
|
||
|
artifact distZip
|
||
|
}
|
||
|
}
|
||
|
}
|