Commit Graph

108 Commits

Author SHA1 Message Date
Brian Clozel 3bcd30e811 Remove API diff Gradle plugin configuration
We have not published API diffs for a while now so we should remove the
configuration entirely from our build.
2023-11-23 16:19:20 +01:00
Juergen Hoeller ca9634143c Upgrade to Reactor 2023.0.0
Includes Protobuf 3.25.0, Artemis 2.31.2, Checkstyle 10.12.5

Closes gh-31557
2023-11-15 14:06:43 +01:00
Stéphane Nicoll 5c6232e681 Polish "Order modifiers to align with JLS"
See gh-31368
2023-10-17 16:16:58 +02:00
Stéphane Nicoll 27431b5138 Polish "Enable checkstyle in buildSrc"
See gh-31445
2023-10-17 15:53:37 +02:00
Johnny Lim e95ba4c205 Enable checkstyle in buildSrc
See gh-31445
2023-10-17 15:53:37 +02:00
Stéphane Nicoll 73a5229b03 Polish 2023-10-17 15:53:28 +02:00
Stéphane Nicoll 370c8e0b9e Do not enable spring javaformat plugin
We do not use the plugin, but rather apply some checkstyle rules that
should be available on the classpath.

Closes gh-31448
2023-10-17 15:46:53 +02:00
Stéphane Nicoll 1e7fc6035d Merge branch '6.0.x' 2023-10-12 16:19:49 +02:00
Stéphane Nicoll d05ac097dd Polish "Replace deprecated method getBuildDir()"
See gh-31416
2023-10-12 16:14:23 +02:00
Victor Georgescu 35103b0cd1 Replace deprecated method getBuildDir()
See gh-31416
2023-10-12 16:10:40 +02:00
Juergen Hoeller 841448877a Upgrade to Reactor 2023.0.0-RC1
Includes Jetty 12.0.2 and Checkstyle 10.12.4

Closes gh-31406
2023-10-11 00:46:24 +02:00
ali dandach 1d12c74042 Use Objects.equals() for null-safe string comparison
See gh-31305
2023-09-25 08:28:33 +02:00
Brian Clozel 8708a21143 Configure Gradle toolchain auto-provisioning
This commit configures the Foojay resolver plugin in the Gradle build in
order to auto-provision a required JDK distribution if it's not present
already on the host.

Currently the Spring Framework build requires both a JDK 17 and a JDK 21
distribution to build artifacts.

Closes gh-30474
2023-09-22 09:44:12 +02:00
Sam Brannen 5a87f555f8 Update copyright headers 2023-09-08 13:57:41 +02:00
Brian Clozel 3686c457bb Polish Aggregate Javadoc task
Closes gh-31173
2023-09-07 15:29:25 +02:00
Brian Clozel c93ae250f9 Stop publishing distribution zip artifact
Prior to this commit, the Spring Framework build would publish several
zip artifacts:

* a "*-schema.zip" containing all the XSD schemas produced
* a "*-docs.zip" containing the API docs
* a "*-dist.zip" containing all of the above, plus module jars

Since the reference docs are now produced by Antora in a separate
process, the "*-docs.zip" does not contain the reference docs anymore.
But it still contains the API docs which are automatically fetched from
the artifact repository and published on the docs.spring.io website.

This commit intends to update the current arrangement and optimize the
build.

First, the "*-dist.zip" is not published anymore, since it cannot be
consumed anyway by the community: repo.spring.io does not distribute
release artifacts publicly, developers are expected to get them from
Maven Central. This arrangement is quite dated anyway and is not really
useful in current application build setups.

The generation of API docs is moved to a new "framework-api" module,
separating it from the reference docs module ("framework-docs") which
contains Java, Kotlin and Asciidoctor sources. This removes the custom
javadoc aggregation task and instead uses a dedicated Gradle plugin.

This change also adds a new `-PskipDocs` Gradle project property that
skips entirely the documentation tasks (javadoc, kdocs) as well as the
"distrbution" tasks managed in the framework-api module.
This allows developers to publish locally a SNAPSHOT of Spring Framework
without creating the entire documentation distribution. This is
particularly useful for local testing.

For example, `$ ./gradlew pTML -PskipDocs`.

Closes gh-31049
2023-08-30 12:15:23 +02:00
Sam Brannen c91841883c Upgrade to Checkstyle 10.12.3 2023-08-28 14:52:49 +02:00
Sam Brannen 9e4b95ef3c Upgrade to spring-javaformat-checkstyle 0.0.39 2023-08-28 14:50:28 +02:00
Sam Brannen 63fe45d92a Update copyright headers 2023-07-15 13:11:29 +02:00
Eric Haag 1b27a7baab Remove explicit cross project task dependency
Previously, the runtimeHintsTest task configuration made a cross
project task reference to obtain the jar path of spring-core-test
to use in the -javaagent argument.

With this change, a dedicated configuration exists to resolve the
project artifact without the need to reference the jar task of
spring-core-test.

Closes gh-30838
2023-07-10 22:42:37 +02:00
Eric Haag d40c10e00f Evaluate runtime hints agent parameter lazily
Previously, an afterEvaluate call was used to read the values of the
runtimeHintsAgent extension and the -javaagent parameter supplied to
the runtimeHintsTest task was evaluated eagerly.

With this change the construction of the -javaagent parameter is
deferred until task execution and the extension properties are
evaluated lazily.

See gh-30838
2023-07-10 22:42:37 +02:00
Eric Haag 5d022d2a24 Fix build cache miss in runtimeHintsTest task
Prior to this change, a build cache miss would occur in
runtimeHintsTest tasks when executing the build from two different
locations, causing the tasks to re-execute. This was due to an
absolute path to the agent jar being included in the -javaagent
argument supplied to the test JVM process.

This change introduces a RuntimeHintsAgentArgumentProvider allowing
finer grained control over the way Gradle computes the build cache
key. With this change, the contents of the agent jar file are
considered, rather than the absolute file location.

See gh-30838
2023-07-10 22:42:37 +02:00
Juergen Hoeller b4ed3fbcd0 Upgrade to Checkstyle 10.12.1 2023-06-30 13:02:38 +02:00
Juergen Hoeller b8b88e638b Upgrade to Checkstyle 10.12 2023-06-04 18:54:30 +02:00
Juergen Hoeller 657fe1fa43 Merge branch '6.0.x' 2023-05-08 14:52:26 +02:00
Rob Winch 601de66c03 nohttp exclude **/.gradle/** 2023-05-04 17:47:37 +01:00
Sébastien Deleuze f469eff97b Update RuntimeHintsAgentPlugin to use the native image code path
RuntimeHintsAgentPlugin purpose is to verify that the reflective
invocations expected match the ones performed.

gh-30242 introduces a code path where the reflective invocation
is skipped when running on native.

This issue set the system property "org.graalvm.nativeimage.imagecode"
to "runtime" when running runtime tests with the agent in order to
make sure the code path tested for those tests is the native one.

Closes gh-30422
2023-05-04 15:31:31 +02:00
Simon Baslé 33b4995547 Fix glob pattern in CheckstyleConventions to be Windows-compatible
On windows, the `*` character is not allowed in a directory's name.
When trying to append a glob pattern to a `Path` (`path.resolve("**")`),
if the underlying `Path.getFileSystem()` is windows then an
`InvalidPathException` is thrown.

The NoHttp plugin doesn't really need a `Path` but a glob `String`, so
this commit uses a simple String concatenation in order to append the
wildcard part (with the canonical path separator for good measure).

Closes gh-30355
2023-04-20 16:44:58 +02:00
Sam Brannen d446de62a4 Update copyright headers 2023-04-19 15:55:11 +02:00
Sam Brannen 65a430bb42 Upgrade to Checkstyle 10.9.3 again
Commit ed4404f350 inadvertently switched back to 10.9.1.
2023-04-18 14:09:43 +02:00
Brian Clozel da88ac8cca Move NoHttp config to Gradle conventions
See gh-30339
2023-04-14 12:31:43 +02:00
Brian Clozel 5c574b9878 Refactor toolchain support in Gradle build
This commit removes the `-PmainToolchain` option from our build, since
it was not broadly used. Instead, the language level is now configured
in the `JavaConventions` for JDK 17.

The `-PtestToolchain` option is still available for testing Spring
Framework with other JDKs (i.e., compiling and running tests with a JDK
that's not the baseline).

See gh-30339
2023-04-14 10:30:12 +02:00
Brian Clozel 9562a1c146 Move build test configuration to Gradle convention
This commit moves the Gradle test configuration to a convention so it
can be applied to all test tasks, including from other source sets.

See gh-30339
2023-04-14 10:27:56 +02:00
Brian Clozel ed4404f350 Move checkstyle config to Gradle convention
This commit moves the checkstyle conventions from the build.gradle
script to a buildSrc convention, ensuring that the same configuration is
applied to all checkstyle tasks.

See gh-30339
2023-04-14 10:27:52 +02:00
Sam Brannen db29b65399 Polishing 2023-03-24 16:05:40 +01:00
Brian Clozel a516ed8739 Upgrade Gradle Enterprise & Conventions plugins 2023-01-10 09:10:59 +01:00
Juergen Hoeller 459e8a1ea5 Deprecate LocalVariableTableParameterNameDiscoverer completely
LocalVariableTableParameterNameDiscoverer is not registered by default anymore now.
Java sources should be compiled with `-parameters` instead (available since Java 8).
Also retaining standard Java parameter names for all of Spring's Kotlin sources now.

Closes gh-29531
2022-11-22 19:26:15 +01:00
Brian Clozel 21414bc265 Move Kotlin Gradle build config to convention
This commit moves the Kotlin build configuration from the Gradle DSL
to a dedicated convention in buildSrc.
2022-11-02 10:59:39 +01:00
Arjen Poutsma ca33752267 Upgrade to Jackson 2.14.0-rc3
This commit upgrades Jackson to 2.14.0-rc3, which resolves two
outstanding issues Spring Framework had with rc2. This commit reverts
the changes made due to those issues, see
https://github.com/FasterXML/jackson-core/issues/824, and
https://github.com/FasterXML/jackson-module-kotlin/issues/582.

Closes gh-29405
2022-10-31 10:35:10 +01:00
Arjen Poutsma f99c02fc94 Upgrade to Jackson 2.14.0-rc2
This commit upgrades Jackson to 2.14.0-rc2, and uses the new
ByteBufferFeeder in Jackson2Tokenizer.

Unfortunately, because of https://github.com/FasterXML/jackson-core/issues/478,
we had to change the CompilerConventions to suppress class file warnings.

Closes gh-29343
2022-10-19 11:05:40 +02:00
Brian Clozel 6b0f6e9f27 Apply Gradle Test Retry plugin
The plugin is configured to detect flaky tests and retry them 3 times
when running on the CI, but still reports failures. This will provide a
standard way to detect flaky tests as failures and successful attempts
are shown in the tests report.
2022-10-06 13:54:28 +02:00
Phillip Webb 9d1e9703ae Include shadowed jar source in published source artifacts
Add a new `ShadowSource` Gradle task and update `spring-core.gradle`
to include source for cglib, javapoet and objenesis.

Closes gh-28892

Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>
2022-07-30 10:25:58 +01:00
Brian Clozel 10e4965f99 Guard against new Spring modules in ApiDiff task
Prior to this commit, the ApiDiff Gradle task would be configured for
all submodules of the Spring Framework project and would assume that
they all existed for the baseline version considered for the API diff.

This would cause issues when:
* the sub-project is not published as it's not an official "spring-*"
  module
* the "spring-*" module is new and did not exist for the baseline
  version

This commit ensures that only "spring-*" modules are considered for this
task and that we trigger an early resolution of the baseline version -
if the version doesn't exist, a warn message is logged and we assume
that this is a new module, to be compared with an empty configuration.

This commit also renames the "spring-core-graalvm" project to
"graalvm-feature", since this sub-project is not an official module
published to Maven Central, but rather an internal dependency.

Fixes gh-28818
2022-07-28 10:51:53 +02:00
Brian Clozel fc1408f827 Configure RuntimeHintsAgent in test suite
This commit configures the `RuntimeHintsAgent` in the Spring Framework
test suite.
Instead of applying the agent to the entire test suite, and possibly
interfering with other tests, this commit adds a new custom Gradle
plugin that does the following:

* create a new test task named `"runtimeHintsTest"`
* run this task with the runtime hints java agent
* only execute tests tagged with `"RuntimeHintsTests"`

See gh-27981
2022-06-30 18:20:25 +02:00
Brian Clozel 2d9c9fe9cc Configure Spring Milestone repository for apiDiff task
Prior to this commit, the `apiDiff` custom Gradle task would only use
the configured repositories in the build to generated the API diff
report. This causes issues when the report has to be generated against a
previous milestone: the Spring Framework build only relies on Maven
Central and a specific `libs-spring-framework-build` repository for
building the project. In this case, the task cannot resolve the previous
milestone artifacts to generate the report.

This commit improves the `ApiDiffPlugin` to automatically add the Spring
Milestone repository to the root project configuration when the task is
executed.

Fixes gh-27928
2022-01-13 12:24:39 +01:00
Brian Clozel f53bf8e9e1 Merge branch '5.3.x' 2021-09-15 14:44:39 +02:00
Brian Clozel 00eef79e5c Upgrade to JApicmp Gradle Plugin 0.3.0
Fixes gh-27414
2021-09-15 14:40:42 +02:00
Brian Clozel c0e479460e Switch CI pipeline to a JDK17 baseline
This commit introduces a new `spring-framework-6.0.x` CI pipeline with
JDK 17 baseline.

Note that Kotlin still uses a JDK11 baseline for now, this will be
addressed in gh-27413.

Closes gh-27409
2021-09-15 12:37:10 +02:00
Sébastien Deleuze 3f66ef7aee Compile with parameter names
Compiled code should contain parameter names to avoid the need
for class resources to be included in native image builds.

Closes gh-27369
2021-09-07 15:08:44 +02:00
Sam Brannen d7ea4d230f Remove Eclipse-specific code from OptionalDependenciesPlugin
To support the recent changes to our `optional` dependencies plugin,
this commit removes the Eclipse-specific code which no longer appears
to be necessary.

Closes gh-27365
2021-09-07 10:49:48 +02:00