Commit Graph

71 Commits

Author SHA1 Message Date
Sébastien Deleuze 22a750f378 Replace build-time initialization by constant fields
This commit leverages a subset of @philwebb initial experimentation
to compute at build time the value of specific boolean static fields
in native images. This enhancement is implemented for now as a
GraalVM feature.

The goal here is to keep an optimized footprint via build time code
removal without leveraging build-time class initialization which is known
for the blocking compatibility issues it introduces due to its viral nature.

For now, the static fields initialized at build time with native are:
 - NativeDetector#imageCode
 - Fields with a name ending by "Present" in "org.springframework" package
   typically used for classpath check with ClassUtils#isPresent

Closes gh-28624
2022-06-24 13:54:20 +02:00
Sam Brannen 8e245e4410 Remove commented-out custom stylesheet for Javadoc
The team has decided to use the default Javadoc stylesheet with JDK 17.

Closes gh-27496
2021-10-20 13:07:45 +02:00
Sam Brannen f78d9cdf22 Remove configuration of obsolete html5 javadoc option 2021-10-19 16:58:36 +02:00
Sam Brannen aa5a2a8600 Disable custom stylesheet for Javadoc
The custom stylesheet used with JDK 8 no longer works with JDK 17.

Thus in order to make the generated Javadoc usable, we are disabling
the custom stylesheet for the time being.

See gh-27496
2021-10-19 16:42:22 +02:00
Sam Brannen 030ba52805 Merge branch '5.3.x' 2021-09-29 16:56:33 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Brian Clozel ca34d0cce8 Polish Gradle upgrade
Closes gh-26870
2021-09-13 10:06:27 +02:00
Brian Clozel cecc0849a8 Upgrade to Gradle 7.2
This commit upgrades Gradle to 7.2.
Gradle configuration names are updated accordingly.
This also upgrades Gradle build plugins.

See gh-26870
2021-09-13 09:37:35 +02:00
Sam Brannen 9c0825629b Reintroduce left-hand side navigation in ref docs
A side effect of 71995a9087 caused the
dynamic table of contents in the left-hand side navigation to no longer
be displayed, likely due to the missing "details" DIV.

This commit addresses this issue by applying the custom header only to
index.adoc.

Consequently, the TOC is now displayed again on all pages except the
index page, but the customized header is no longer applied to those
pages.

We may revisit this issue if we decide that we want the custom header
on all pages (and not just the index page).

Closes gh-27177
2021-07-17 17:53:43 +03:00
Arjen Poutsma b9d65eef61 Dropping accidentally inserted copyright notice 2021-07-07 13:54:07 +02:00
Arjen Poutsma 8d747298de Fixing the build 2021-07-07 13:49:10 +02:00
Sam Brannen 3214786757 Define global Asciidoc attributes once
This commit defines the doc-root and api-spring-framework attributes
once in docs.gradle instead of duplicating them in each *.adoc file.

This commit also introduces a new docs-spring-framework global
attribute.
2021-06-22 18:39:33 +02:00
Sam Brannen 71995a9087 Introduce custom header for HTML5 ref docs
This commit disables the automatic header generation from Asciidoc's
default template and replaces it with a custom header that omits the
"Version" label before the revision number. The revision number is also
displayed in a simple span tag in order to reduce the amount of
vertical space taken by the header.
2021-06-21 17:52:18 +02:00
Brian Clozel c7c35aff42 Fix missing attribute in reference documentation
This commit adds the missing `spring-framework-main-code` asciidoctor
attribute in the reference documentation.

Fixes gh-27041
2021-06-09 09:21:28 +02:00
Brian Clozel 3b92d45984 Upgrade reference docs dependencies
This commit upgrades the spring-doc-resources dependency to 0.2.5
and the spring-asciidoctor-extensions-block-switch to 0.5.0
2020-12-08 11:38:39 +01:00
Sébastien Deleuze 4503260282 Fix Dokka warnings 2020-10-27 11:21:55 +01:00
Sam Brannen 00651a3e38 Fix forward-merge errors in 6f04c7b60e and 687c3985d5
See gh-24865
2020-09-25 11:22:29 +02:00
Brian Clozel 687c3985d5 Fix merge-forward 2020-09-24 19:54:04 +02:00
Brian Clozel 6f04c7b60e Merge branch '5.2.x' 2020-09-24 18:11:32 +02:00
Brian Clozel a532c527dd Fix missing reference doc from docs archive
Prior to this commit, the `docsZip` task would not reference the new
output locations for the `asciidoctor` and `asciidoctorPdf` tasks.
This results with missing reference docs in the docs zip.

This commit updates the input locations of the Zip task to include the
produced reference docs.

Fixes gh-25783
2020-09-24 17:49:37 +02:00
Brian Clozel 6e7be76278 Upgrade to AsciidoctorJ 3.1.0
Closes gh-24991
2020-09-23 10:06:13 +02:00
Sam Brannen 2342f5f48a Remove unnecessary folders and files from PDF reference documentation
Prior to this commit, the asciidoctor Gradle task was configured to
generate both the HTML5 and PDF backends. Unfortunately, this resulted
in resources such as HTML, JavaScript, CSS, and images being published
alongside the generated PDF documents.

This commit addresses this issue by introducing the use of a dedicated
asciidoctorPdf Gradle task. The existing asciidoctor Gradle task has
been modified to only generate HTML5 output. Both of these tasks now
share common configuration supplied by the updated asciidoctorj Gradle
task.

In addition, the asciidoctor task now depends on the asciidoctorPdf
task. Thus, invoking `./gradlew asciidoctor` will still generate both
the HTML5 and PDF outputs; whereas, `./gradlew asciidoctorPdf` will
generate only the PDF outputs. We may later decide to rework the tasks
to introduce a dedicated asciidoctorHtml task so that we can generate
the HTML outputs without having to generate the PDF outputs (which are
more time consuming).

See gh-25783
2020-09-21 11:43:08 +02:00
Sam Brannen 4179ea6f22 Remove unnecessary folders and files from PDF reference documentation
Prior to this commit, the asciidoctor Gradle task was configured to
generate both the HTML5 and PDF backends. Unfortunately, this resulted
in resources such as HTML, JavaScript, CSS, and images being published
alongside the generated PDF documents.

This commit addresses this issue by introducing the use of a dedicated
asciidoctorPdf Gradle task. The existing asciidoctor Gradle task has
been modified to only generate HTML5 output. Both of these tasks now
share common configuration supplied by the updated asciidoctorj Gradle
task.

In addition, the asciidoctor task now depends on the asciidoctorPdf
task. Thus, invoking `./gradlew asciidoctor` will still generate both
the HTML5 and PDF outputs; whereas, `./gradlew asciidoctorPdf` will
generate only the PDF outputs. We may later decide to rework the tasks
to introduce a dedicated asciidoctorHtml task so that we can generate
the HTML outputs without having to generate the PDF outputs (which are
more time consuming).

See gh-25783
2020-09-18 18:10:28 +02:00
Sébastien Deleuze 0db3f2b4de Publish documentation under reference/html folder
This is done:
 - For consistency with other Spring projects
 - Because it is probably a better option to use reference instead of
   spring-framework-reference (spring-framework is already present in
   the URL)
 - To improve PDF documentation discoverability

As a consequence:
 - spring-framework-reference HTML documentation is now published
   under reference/html
 - spring-framework-reference/pdf PDF documentation is now published
   under reference/pdf

The following permanent redirect should be created before Spring
Framework 5.3.0 release:
 - current/spring-framework-reference/pdf/* to current/reference/pdf/*
 - current/spring-framework-reference/* to current/reference/html/*

Closes gh-25071
2020-09-12 18:14:36 +02:00
Sam Brannen 65e8d85142 Only include PNG files in reference manual
The `images` folder contains some files used to create the images, such
as OmniGraffle and SVG.

This commit modifies the `include` pattern to ensure that only `*.png`
files are copied from the source folder to the published reference
manual.
2020-04-29 17:14:11 +02:00
Brian Clozel fdfe58362e Upgrade Gradle plugins 2020-04-29 15:23:14 +02:00
Sam Brannen 27adbb9a35 Use googlecode syntax highlighting in reference manual
Closes gh-24865
2020-04-28 12:25:24 +02:00
Sam Brannen b69f081a79 Upgrade to spring-doc-resources 0.2.2.RELEASE 2020-04-28 12:20:04 +02:00
Sam Brannen 154fa29471 Upgrade to spring-doc-resources 0.2.1
See gh-24865
2020-04-14 13:36:11 +02:00
Jay Bryant b7eb983107 Update to spring-doc-resources version 0.2.0
This commit updates the spring-doc-resources version to 0.2.0 to get the
latest look and feel in the HTML version of the reference manual.

Closes gh-24831
2020-04-01 14:52:58 +02:00
Sébastien Deleuze 623a019ef8 Upgrade to Dokka 0.10.1
Closes gh-24764
2020-03-23 13:01:06 +01:00
Sam Brannen e500456f1c Publish distribution zip files again
A change in `docs.gradle` in 5.2.4 resulted in distribution zip files
no longer being published to
https://repo.spring.io/release/org/springframework/spring/.

This commit fixes this by updating the `mavenContent` configuration as
suggested by @wilkinsona.

Closes gh-24605
2020-03-16 15:43:57 +01:00
Andy Wilkinson 02e90a8645
Upgrade to Spring Asciidoctor Extensions 0.4.0.RELEASE
0.4.0 provides built-in support for remembering a user's selections
using local storage. This replaces the custom switch language
JavaScript.

The selection is stored using a key derived from the
options that were available. Concretely, when the options are Java or
Kotlin, the local storage key is java-kotlin. Similarly, if the
choices were Java, Kotlin, and XML, the key would be java-kotlin-xml.

Given local storage's domain and protocol scoping, the nature of the
key that's used for storage will allow a user's selections to be
applied across all documentation hosted on https://docs.spring.io that
offer the same options.

Closes gh-24481
2020-02-07 12:16:02 +01:00
Rob Winch e66e41029c Asciidoctor Warnings Are Fatal
Ensure we don't get any more warnings within Asciidoctor build

Issue gh-24427
2020-01-24 15:51:59 -06:00
Andy Wilkinson 1ec15ba9c2 Always configure PDF backend as task will only run on cache miss
Previously, the Asciidoctor task was not cacheable and generating the
PDF documentation was very slow. To improve build times, the PDF
documentation was not generated for snapshot builds.

The upgrade to 2.4.0 of the Asciidoctor Gradle pluging means that the
Asciidoctor task is now cacheable. As such, its tasks will only run
when the documentation has changed. This should allow PDF
documentation to be published for every build without slowing things
down too much and the cost of generating the documentation will only
be incurred when there is a change to the documentation.

See gh-24216
2020-01-09 10:17:44 +01:00
Andy Wilkinson 2ac5744323 Upgrade to Asciidoctor Gradle Plugin 2.4
This commit updates the build to use the latest version of the
Asciidoctor Gradle Plugin. One significant new feature is that the
plugin's tasks are now cacheable.

Closes gh-24216
2020-01-09 10:17:27 +01:00
YuDongYing 4e5ae54417 Fix schemaZip Gradle task on MS Windows
Prior to this commit, the schemaZip Gradle task failed to find Spring
schema files on MS Windows due to path separators hard coded to forward
slashes that are not compatible with the Windows operating system.

Consequently, a full build failed on Windows since the distZip task was
not able to locate the zipped schema archive that the schemaZip task
failed to create.

This commit fixes this by updating the schemaZip task to search for
schema files using backslashes as well as forward slashes.

Closes gh-23933
2019-11-13 14:49:25 +01:00
Sam Brannen 3f9359aa83 Polish docs.gradle 2019-10-05 17:44:40 +02:00
Brian Clozel a4257f84e7 Fix base directory in distribution zip
Fixes gh-23745
2019-10-02 10:00:33 +02:00
Brian Clozel fbe05f0369 Upgrade to Spring Doc Resources 0.1.3
Closes gh-23679
2019-09-26 14:27:07 +02:00
Brian Clozel 716f928e79 Upgrade to Spring Doc Resources 0.1.3.BUILD-SNAPSHOT
See gh-23679
2019-09-23 16:53:39 +02:00
Brian Clozel 03701018c6 Cache "spring-doc-resources" archive between builds
This commit configures the Gradle Download plugin that's used a build
step when generating the reference documentation. Here we're making sure
that the task is caching and reusing the resource if it's been
downloaded already.

See gh-23282
2019-08-21 15:38:16 +02:00
Brian Clozel b3aebf9e9b 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
2019-08-20 23:36:59 +02:00
Brian Clozel e9523161f0 Revert "Revert "Refactor Gradle tasks in Spring Framework build""
This reverts commit fb0d618751.
2019-08-20 20:26:43 +02:00
Stephane Nicoll fb0d618751 Revert "Refactor Gradle tasks in Spring Framework build"
This reverts commit 1539ba8991.
2019-08-20 20:07:11 +02:00
Brian Clozel 1539ba8991 Refactor Gradle tasks in Spring Framework build
This commit reorganizes tasks and scripts in the build to only apply
them where they're needed. We're considering here 3 "types" of projects
in our build:
* the root project, handling documentation, publishing, etc
* framework modules (a project that's published as a spring artifact)
* internal modules, such as the BOM, our coroutines support and our
integration-tests

With this change, we're strealining the project configuration for all
spring modules and only applying plugins when needed (typically our
kotlin support).

See gh-23282
2019-08-20 18:17:02 +02:00
Sebastien Deleuze eff9cae314 Add global language switch capabilities to the refdoc
See gh-21778
2019-08-13 16:29:47 +02:00
Sebastien Deleuze 96658235c8 Add Kotlin code snippets to core refdoc
This commit introduces Kotlin code snippets, for now
in the core reference documentation. Other sections
will follow, as well as improvements like global
language switch.

See gh-21778
2019-08-12 15:45:18 +02:00
Sam Brannen 8ca834b868 Merge branch '5.1.x' 2019-07-09 18:24:03 +02:00
Sam Brannen 99758b56d3 Ensure Javadoc is generated using UTF-8 encoding
Fixes gh-23253
2019-07-09 18:22:11 +02:00