"Fossies" - the Fresh Open Source Software Archive

Member "spring-framework-6.0.4/framework-docs/framework-docs.gradle" (11 Jan 2023, 6381 Bytes) of package /linux/misc/spring-framework-6.0.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Java source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "framework-docs.gradle": 6.0.2_vs_6.0.3.

    1 description = "Spring Framework Docs"
    2 
    3 apply plugin: 'kotlin'
    4 apply plugin: 'org.asciidoctor.jvm.convert'
    5 apply plugin: 'org.asciidoctor.jvm.pdf'
    6 apply from: "${rootDir}/gradle/publications.gradle"
    7 
    8 
    9 configurations {
   10     asciidoctorExtensions
   11 }
   12 
   13 dependencies {
   14     api(project(":spring-context"))
   15     api(project(":spring-web"))
   16     api("jakarta.servlet:jakarta.servlet-api")
   17 
   18     implementation(project(":spring-core-test"))
   19     implementation("org.assertj:assertj-core")
   20 }
   21 
   22 jar {
   23     enabled = false
   24 }
   25 
   26 javadoc {
   27     enabled = false
   28 }
   29 
   30 dependencies {
   31     asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.3"
   32 }
   33 
   34 repositories {
   35     maven {
   36         url "https://repo.spring.io/release"
   37     }
   38 }
   39 
   40 /**
   41  * Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
   42  */
   43 task api(type: Javadoc) {
   44     group = "Documentation"
   45     description = "Generates aggregated Javadoc API documentation."
   46     title = "${rootProject.description} ${version} API"
   47 
   48     dependsOn {
   49         moduleProjects.collect {
   50             it.tasks.getByName("jar")
   51         }
   52     }
   53     doFirst {
   54         classpath = files(
   55                 // ensure the javadoc process can resolve types compiled from .aj sources
   56                 project(":spring-aspects").sourceSets.main.output
   57         )
   58         classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
   59     }
   60 
   61     options {
   62         encoding = "UTF-8"
   63         memberLevel = JavadocMemberLevel.PROTECTED
   64         author = true
   65         header = rootProject.description
   66         use = true
   67         overview = "framework-docs/src/docs/api/overview.html"
   68         splitIndex = true
   69         links(project.ext.javadocLinks)
   70         addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
   71         addBooleanOption('Werror', true) // fail build on Javadoc warnings
   72     }
   73     source moduleProjects.collect { project ->
   74         project.sourceSets.main.allJava
   75     }
   76     maxMemory = "1024m"
   77     destinationDir = file("$buildDir/docs/javadoc")
   78 }
   79 
   80 /**
   81  * Produce KDoc for all Spring Framework modules in "build/docs/kdoc"
   82  */
   83 rootProject.tasks.dokkaHtmlMultiModule.configure {
   84     dependsOn {
   85         tasks.getByName("api")
   86     }
   87     moduleName.set("spring-framework")
   88     outputDirectory.set(project.file("$buildDir/docs/kdoc"))
   89 }
   90 
   91 asciidoctorj {
   92     version = '2.4.3'
   93     fatalWarnings ".*"
   94     options doctype: 'book', eruby: 'erubis'
   95     attributes([
   96             icons: 'font',
   97             idprefix: '',
   98             idseparator: '-',
   99             revnumber: project.version,
  100             sectanchors: '',
  101             sectnums: '',
  102             'spring-version': project.version
  103     ])
  104 }
  105 
  106 /**
  107  * Generate the Spring Framework Reference documentation from
  108  * "src/docs/asciidoc" in "build/docs/ref-docs/html5".
  109  */
  110 asciidoctor {
  111     baseDirFollowsSourceDir()
  112     configurations "asciidoctorExtensions"
  113     sources {
  114         include '*.adoc'
  115     }
  116     resources {
  117         from(sourceDir) {
  118             include 'images/*.png'
  119         }
  120     }
  121     outputDir "$buildDir/docs/ref-docs/html5"
  122     outputOptions {
  123         backends "spring-html"
  124     }
  125     forkOptions {
  126         jvmArgs += ["--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"]
  127     }
  128     logDocuments = true
  129 }
  130 
  131 asciidoctor.mustRunAfter "check"
  132 
  133 /**
  134  * Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
  135  * in "build/docs/ref-docs/pdf".
  136  */
  137 asciidoctorPdf {
  138     baseDirFollowsSourceDir()
  139     configurations 'asciidoctorExtensions'
  140     sources {
  141         include 'spring-framework.adocbook'
  142     }
  143     outputDir "$buildDir/docs/ref-docs/pdf"
  144     forkOptions {
  145         jvmArgs += ["--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"]
  146     }
  147     logDocuments = true
  148 }
  149 
  150 /**
  151  * Zip all docs (API and reference) into a single archive
  152  */
  153 task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', rootProject.tasks.dokkaHtmlMultiModule]) {
  154     group = "Distribution"
  155     description = "Builds -${archiveClassifier} archive containing api and reference " +
  156             "for deployment at https://docs.spring.io/spring-framework/docs/."
  157 
  158     archiveBaseName.set("spring-framework")
  159     archiveClassifier.set("docs")
  160     from("src/dist") {
  161         include "changelog.txt"
  162     }
  163     from (api) {
  164         into "javadoc-api"
  165     }
  166     from ("$asciidoctor.outputDir") {
  167         into "reference/html"
  168     }
  169     from ("$asciidoctorPdf.outputDir") {
  170         into "reference/pdf"
  171     }
  172     from (rootProject.tasks.dokkaHtmlMultiModule.outputDirectory) {
  173         into "kdoc-api"
  174     }
  175 }
  176 
  177 /**
  178  * Zip all Spring Framework schemas into a single archive
  179  */
  180 task schemaZip(type: Zip) {
  181     group = "Distribution"
  182     archiveBaseName.set("spring-framework")
  183     archiveClassifier.set("schema")
  184     description = "Builds -${archiveClassifier} archive containing all " +
  185             "XSDs for deployment at https://springframework.org/schema."
  186     duplicatesStrategy DuplicatesStrategy.EXCLUDE
  187     moduleProjects.each { module ->
  188         def Properties schemas = new Properties();
  189 
  190         module.sourceSets.main.resources.find {
  191             (it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
  192         }?.withInputStream { schemas.load(it) }
  193 
  194         for (def key : schemas.keySet()) {
  195             def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
  196             assert shortName != key
  197             File xsdFile = module.sourceSets.main.resources.find {
  198                 (it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
  199             }
  200             assert xsdFile != null
  201             into (shortName) {
  202                 from xsdFile.path
  203             }
  204         }
  205     }
  206 }
  207 
  208 /**
  209  * Create a distribution zip with everything:
  210  * docs, schemas, jars, source jars, javadoc jars
  211  */
  212 task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
  213     group = "Distribution"
  214     archiveBaseName.set("spring-framework")
  215     archiveClassifier.set("dist")
  216     description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
  217             "suitable for community download page."
  218 
  219     ext.baseDir = "spring-framework-${project.version}";
  220 
  221     from("src/docs/dist") {
  222         include "readme.txt"
  223         include "license.txt"
  224         include "notice.txt"
  225         into "${baseDir}"
  226         expand(copyright: new Date().format("yyyy"), version: project.version)
  227     }
  228 
  229     from(zipTree(docsZip.archiveFile)) {
  230         into "${baseDir}/docs"
  231     }
  232 
  233     from(zipTree(schemaZip.archiveFile)) {
  234         into "${baseDir}/schema"
  235     }
  236 
  237     moduleProjects.each { module ->
  238         into ("${baseDir}/libs") {
  239             from module.jar
  240             if (module.tasks.findByPath("sourcesJar")) {
  241                 from module.sourcesJar
  242             }
  243             if (module.tasks.findByPath("javadocJar")) {
  244                 from module.javadocJar
  245             }
  246         }
  247     }
  248 }
  249 
  250 distZip.mustRunAfter moduleProjects.check
  251 
  252 publishing {
  253     publications {
  254         mavenJava(MavenPublication) {
  255             artifact docsZip
  256             artifact schemaZip
  257             artifact distZip
  258         }
  259     }
  260 }