Enable users of Java 8 to build their projects using Gradle (which checks the required JVM version by using the Gradle .module file).
Note
Don't be intimidated by the number of files in this PR. Most of the changes are simply moving files to arrange the sources into the new sourceSet structure.
Design
Merged the bugsnag-spring and bugsnag-spring:javax projects back together in favor of using a split sourceSet system with Gradle managed tool chains. This allows us to define a structure similar to that used by Kotlin-Multiplatform:
src/common - common to both the older (javax) and new jakarta implementations of the bugsnag-spring notifier, built using a Java 8 toolchain
src/javax - the implementation classes that compile against the javax packages, depending on common and built using a Java 8 toolchain
src/jakarta - implementation classes that compile against the jakarta packages and are compatible with Spring Boot 3, built using a Java 17 toolchain
A Gradle configuration is defined for each of these sourceSets in order to avoid the default behaviors of Gradles intrinsic Java sourceSet configurations and give us finer control over the exact nature of our classpaths (where both javax and jakarta include common).
Changeset
Merged the bugsnag-spring:javax module back into bugsnag-spring as a sourceSet and configuration
Split the bugsnag-spring project into 3 sourceSets: common, javax, jakarta
Split the unit tests for bugsnag-spring into javaxTest and jakartaTest
Used Gradle toolchains to ensure that bugsnag-spring builds under Java 8, with the jakarta related sources building under Java 17
Changed the versionMapping of the publication to use the version resolved from the javax configuration (instead of the latest used by the entire project)
Testing
The existing tests pass (although I had to update our standard logback.xml configuration, which included an option that was removed a while back).
Manually tested publishing locally to check the module version metadata was correct:
Goal
Enable users of Java 8 to build their projects using Gradle (which checks the required JVM version by using the Gradle
.module
file).Design
Merged the
bugsnag-spring
andbugsnag-spring:javax
projects back together in favor of using a splitsourceSet
system with Gradle managed tool chains. This allows us to define a structure similar to that used by Kotlin-Multiplatform:src/common
- common to both the older (javax
) and newjakarta
implementations of thebugsnag-spring
notifier, built using a Java 8 toolchainsrc/javax
- the implementation classes that compile against thejavax
packages, depending oncommon
and built using a Java 8 toolchainsrc/jakarta
- implementation classes that compile against thejakarta
packages and are compatible with Spring Boot 3, built using a Java 17 toolchainA Gradle
configuration
is defined for each of thesesourceSets
in order to avoid the default behaviors of Gradles intrinsic JavasourceSet
configurations and give us finer control over the exact nature of our classpaths (where bothjavax
andjakarta
includecommon
).Changeset
bugsnag-spring:javax
module back intobugsnag-spring
as a sourceSet and configurationbugsnag-spring
project into 3 sourceSets: common, javax, jakartabugsnag-spring
intojavaxTest
andjakartaTest
bugsnag-spring
builds under Java 8, with thejakarta
related sources building under Java 17versionMapping
of the publication to use the version resolved from thejavax
configuration (instead of the latest used by the entire project)Testing
The existing tests pass (although I had to update our standard
logback.xml
configuration, which included an option that was removed a while back).Manually tested publishing locally to check the module version metadata was correct: