Commit Graph

174 Commits

Author SHA1 Message Date
Sébastien Deleuze 623a019ef8 Upgrade to Dokka 0.10.1
Closes gh-24764
2020-03-23 13:01:06 +01:00
Sam Brannen 7b94112ec6 Update documentation for custom-java-home.gradle
See gh-24719
2020-03-18 17:10:16 +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
Sam Brannen d481b81b7e Fix copy-n-paste error in custom_java_home.gradle script
See gh-24474
2020-02-12 23:08:42 +01:00
Andy Wilkinson d0d8c6e749
Use Gradle Enterprise Conventions Plugin to configure build scans
Closes gh-24512
2020-02-12 18:14:33 +01:00
Sam Brannen de7bed2ab2 Simplify custom_java_home.gradle script
Setting `options.fork = true` causes the classpath in the forked
compiler process to include Class-Path entries from MANIFEST.MF files
in JARs in the classpath, which results in warnings about missing
classpath entries.

This commit removes the `options.fork = true` declaration and further
simplifies the script.

See gh-24474
2020-02-12 14:30:29 +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
Sam Brannen c648425822 Ignore warnings for missing classpath elements with custom JAVA_HOME
Prior to this commit, the "-Werror" was removed as a command-line
argument in order not to fail the build for missing classpath elements.

This commit reinstates "-Werror" and removes "-Xlink:path" in order to
explicitly ignore warnings for missing classpath elements when executing
the build with a custom JAVA_HOME.

See gh-24474
2020-02-07 10:23:07 +01:00
Sam Brannen ce2c0e4c79 Credit @marcphilipp and @snicoll
See gh-24474
2020-02-06 15:32:51 +01:00
Sam Brannen 8f02e1088d Support alternate JDK versions in Gradle build
This commit adds support for the following two JVM system properties
that control the Gradle build for alternative JDKs (i.e., a JDK other
than the one used to launch the Gradle process).

- customJavaHome: absolute path to the alternate JDK installation to
  use to compile Java code and execute tests. Setting this system
  property causes Groovy 3.0 RC3 to be used instead of 2.5.x. This
  system property is also used in spring-oxm.gradle to determine
  whether JiBX is supported.

- customJavaSourceVersion: Java version supplied to the `--release`
  command line flag to control the Java source and target compatibility
  version. Supported versions include 9 or higher. Do not set this
  system property if Java 8 should be used.

Examples:

./gradlew -DcustomJavaHome=/opt/java/jdk-14 test

./gradlew --no-build-cache -DcustomJavaHome=/opt/java/jdk-14 test

./gradlew -DcustomJavaHome=/opt/java/jdk-14 -DcustomJavaSourceVersion=14 test

See gh-24474
2020-02-06 15:24:19 +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
Sam Brannen 22a888b53d Polish test fixture publication skipping config
Thanks to @jjohannes for the tip.

See gh-23550
2020-01-03 14:56:13 +01:00
Sam Brannen d5f0bb23ae Disable publication of test fixture artifacts
Thanks to @melix for providing the code snippet necessary to achieve
this with Gradle 5.6.x.

See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen c91dd02905 Delete obsolete TestSourcesPlugin
Since we have migrated to Gradle's built-in test fixture support, the
custom TestSourcesPlugin Gradle plugin is now obsolete.

See gh-23550
2020-01-02 16:01:35 +01:00
Andy Wilkinson 7f61f3852c Enable reading from the remote build cache for all
Previously, the remote build cache was only enabled if the
GRADLE_ENTERPRISE_URL environment variable was configured. This meant
that contributors would not benefit from the build time improvements
of the caching without some additional setup.

This commit updates the buildCache configuration so that reading from
the remote build cache at https://ge.spring.io is enabled for all.
Pushing to the cache continues to be disabled unless the required
credentials are provided. Build scan configuration has also been
updated in line with this change. While the server URL is now
hardcoded, publishing is still opt-in via an environment variable.
The exact mechanism by which someone can opt in will change in the
future once some server-side changes have been made. At this point,
only a change to publishAlwaysIf should be necessary.

Closes gh-24105
2019-11-29 17:58:09 +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 f746e9df82 Upgrade to Gradle 5.6.4 2019-11-03 15:04:58 +01:00
Andy Wilkinson 1a54b83ae1 Add opt-in support for remote build cache and pushing to it from CI
This commit provides opt-in enablement of Gradle's remote build
cache. When the GRADLE_ENTERPRISE_URL environment variable is set, its
build cache node will be used as a source of cached output. If both
GRADLE_ENTERPRISE_CACHE_USERNAME and GRADLE_ENTERPRISE_CACHE_PASSWORD
are also set, task output produced by the build will be pushed to the
build cache node for use by subsequent builds.

Closes gh-23883
2019-10-29 12:46:33 +01:00
Sam Brannen fd95646a04 Polish contribution
See gh-23869
2019-10-25 15:26:20 +02:00
Johnny Lim 46a31bc656 Extract build cache settings to a dedicated file
Closes gh-23869
2019-10-25 15:08:11 +02:00
Andy Wilkinson cba91ab28e Stop Created-By manifest header from causing a test task cache miss
Previously, when a project's jar was an input into a test task, a
cache hit required the current build to be using the same JDK as the
one that created the cache entry. This was due to the Created-By
entry in the jar's manifest which will vary if JDKs with different
values for the java.version and java.specification.vendor version are
used.

This commit configures normalization of the runtime classpath to ignore
META-INF/MANIFEST.MF, thereby allowing a cache hit when the tests were
previously run on a different JDK than the one being used now. Typically
this is a different update release being used on a CI agent and a
developer's machine. This change will therefore improve the likelihood
of a cache hit once remote caching has been enabled.

Closes gh-23872
2019-10-25 13:52:48 +02:00
Sam Brannen 243f2890ee Upgrade to Gradle 5.6.3 2019-10-18 11:59:30 +02:00
Sam Brannen 9e066e5272 Revert "Upgrade to Gradle 5.6.3"
This reverts commit 8e72722d7f.
2019-10-18 10:38:40 +02:00
Sam Brannen 8e72722d7f Upgrade to Gradle 5.6.3 2019-10-18 09:52:13 +02: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 a446f572a6 Fix missing project information in generated POMS
This commit ensures that the project name and description are published
with the generated POMs.
2019-09-30 10:22:44 +02:00
Brian Clozel fbe05f0369 Upgrade to Spring Doc Resources 0.1.3
Closes gh-23679
2019-09-26 14:27:07 +02:00
Andy Wilkinson d0adadf3ca Capture maxParallelForks of Test tasks in build scans
The parallel forks configuration of Test tasks can have a big impact
on their execution time. This commit updates the build can
configuration to capture each Test task's maxParallelForks
configuration as custom values in the build scan. This will make this
data available when comparing scans which will be useful as we
experiment with different parallel fork settings to reduce the
build's overall execution time.

Closes gh-23691
2019-09-24 18:25:24 +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
Sam Brannen 00c07e3a50 Indent with tabs 2019-09-12 11:51:44 +02:00
Andy Wilkinson df7e4ad023 Tweak detection of Bamboo
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.

Closes gh-23597
2019-09-06 19:18:46 +02:00
Sam Brannen d817b591e5 Revert "Tweak detection of Bamboo (#23597)"
This reverts commit 35567678ef, reversing
changes made to 807e1d3367.
2019-09-06 19:16:59 +02:00
Sam Brannen 35567678ef
Tweak detection of Bamboo (#23597)
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.
2019-09-06 17:18:10 +02:00
Sam Brannen 807e1d3367 Upgrade to Gradle 5.6.2
See gh-23479
2019-09-06 16:09:01 +02:00
Andy Wilkinson fcda0fb8d9 Tweak detection of Bamboo
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.
2019-09-06 10:08:35 +01:00
Andy Wilkinson 35b967a801 Add opt-in build scan integration with Gradle Enterprise
This commit adds opt-in build scan integration with Gradle Enterprise.
When the GRADLE_ENTERPRISE_URL environment variable is set on a
developer's machine or on CI, a build scan will be automatically
uploaded to Gradle Enterprise at the end of the build.

This initial integration will establish a baseline for Spring
Framework builds. Once that baseline has been established we can use
the build scans to identify ways in which the build can be optimized
and updated to make use of Gradle's build caching which should reduce
build times, significantly so for changes that only affect tasks near
the leaf nodes of the task graph.
2019-09-05 15:16:59 +01:00
Sam Brannen 5af4d22044 Upgrade to Gradle 5.6.1
See gh-23479
2019-08-28 14:53:44 +02:00
Brian Clozel 7cfae94d70 Use resolved dependency versions for published POMs
This commit ensures that Gradle publications are using resolved
dependency versions for Maven publications (i.e. POMs). This is useful
since we're using the Spring dependency management plugin and we can't
rely on declared dependency versions only.

See gh-23282
2019-08-22 16:11:09 +02:00
Brian Clozel 86c734785d Apply Artifactory Gradle plugin
Instead of relying on the CI server to apply and configure this plugin,
this commit does it directly in the Spring Framework build.
This allows us to take full control over which projects are published
and how.

See gh-23282
2019-08-21 20:15:35 +02:00
Brian Clozel 7902ae4c1f Change Gradle publication name for artifactory
This commit switches to the default publication name considered by the
artifactory plugin when it comes to publishing artifacts to the
artifactory repository.

See gh-23282
2019-08-21 18:42:17 +02:00
Brian Clozel 7ce1f5e652 Configure Maven publications with Gradle
Prior to this commit, the build would use a custom task to create a BOM
and manually include/exclude/customize dependencies. It would also use
the "maven" plugin to customize the POM before publication.

This commit now uses a Gradle Java Platform for publishing the Spring
Framework BOM. We're also now using the "maven-publish" plugin to
prepare and customize publications.

This commit also tells the artifactory plugin (which is currently
applied only on the CI) not to publish internal modules.

See gh-23282
2019-08-21 15:39:51 +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
Brian Clozel 6008c61680 Use JApiCmp Gradle plugin for API diffs
This commit removes JDiff from the Spring Framework build and instead,
adds a Gradle plugin that configure JApiCmp tasks on the framework
modules.

Fixes gh-22942
See gh-23282
2019-08-19 10:21:55 +02:00