Commit Graph

9 Commits

Author SHA1 Message Date
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
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
Phillip Webb 3ebdaeabd3 Publish spring-core-test
Closes gh-28558
2022-06-02 18:07:50 -07:00
Phillip Webb 653dc5951d Add module to support testing of generated code
Add a new unpublished `spring-core-test` module to support testing of
generated code. The module include a `TestCompiler` class which can be
used to dynamically compile generated Java code. It also include an
AssertJ friendly `SourceFile` class which uses qdox to provide targeted
assertions on specific parts of a generated source file.

See gh-28120
2022-03-09 11:17:21 +01:00
Brian Clozel 784a6d46c0 Remove BOM workaround
Since Gradle 6.2, the scope information is not published anymore with
the BOM, so we don't need to manually remove it anymore
2020-04-28 15:14:02 +02:00
Brian Clozel ab58e29397 Remove scope information from published BOM
It seems that publishing a Gradle platform as a Maven POM writes all
dependencies with their scope information by default.

We don't want that when publishing the Spring Framework BOM, as it
forces the scope on projects depending on the BOM, unless they've
specified the scope when they added the dependency to their build.

Typically, developers could get spring-test as a compile dependency
without this change.

This commit removes the scope information from the published BOM.

Fixes gh-23660
2019-09-18 15:27:59 +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 e45a3f4738 Rename non-Framework project modules
Prior to this commit, the Spring Framework build would mix proper
framework modules (spring-* modules published to maven central) and
internal modules such as:
* "spring-framework-bom" (which publishes the Framework BOM with all
modules)
* "spring-core-coroutines" which is an internal modules for Kotlin
compilation only

This commit renames these modules so that they don't start with
"spring-*"; we're also moving the "kotlin-coroutines" module under
"spring-core", since it's merged in the resulting JAR.

See gh-23282
2019-08-21 14:32:25 +02:00