Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,6 @@ steps:
run: java-common
command: './gradlew check test'

- label: ':docker: Mazerunner java8 tests batch 1'
key: 'java-mazerunner-tests-1'
depends_on: 'java-jvm-build'
timeout_in_minutes: 30
plugins:
- docker-compose#v3.7.0:
run: java8-mazerunner
- artifacts#v1.9.0:
download: "maven-repository.zip"
command:
- 'features/scripts/assemble-fixtures.sh'
- 'bundle exec maze-runner --exclude=features/[^a-m].*.feature'

- label: ':docker: Mazerunner java8 tests batch 2'
key: 'java-mazerunner-tests-2'
depends_on: 'java-jvm-build'
timeout_in_minutes: 30
plugins:
- docker-compose#v3.7.0:
run: java8-mazerunner
- artifacts#v1.9.0:
download: "maven-repository.zip"
command:
- 'features/scripts/assemble-fixtures.sh'
- 'bundle exec maze-runner --exclude=features/[^n-z].*.feature'

- label: ':docker: Mazerunner java17 tests batch 1'
key: 'java-mazerunner-tests-3'
depends_on: 'java-jvm-build'
Expand Down
207 changes: 28 additions & 179 deletions bugsnag-spring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
ext {
jakartaSpringVersion = '6.0.0'
jakartaSpringBootVersion = '3.0.0'

javaxSpringVersion = '5.3.20'
javaxSpringBootVersion = '2.5.14'
}

apply plugin: 'java-library'
Expand All @@ -15,190 +12,42 @@ repositories {
java {
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

// We use 3 custom configurations and matching sourceSets to avoid the standard behaviours which interfere with
// our compilation structure
configurations {
compileCommon
compileJavax
compileJakarta
}

sourceSets {
common {
java
// common.compileClasspath includes the compileJavax classpath in order to give the common classes access
// to Spring without confusing the dependencies, including it here ensures that any use of javax.* packages
// in src/common will result in test failures (although not compile failures)
// we need the javax.* packages included here so that the compiler can type-check all the way up the hierarchy
// for things like "ServletRequestBindingException extends ServletException"
compileClasspath += configurations.compileCommon + configurations.compileJavax
}
javax {
java
compileClasspath += configurations.compileJavax + common.output + configurations.compileCommon
}
jakarta {
java
compileClasspath += configurations.compileJakarta + common.output + configurations.compileCommon
}
}

// test sourceSets
sourceSets {
commonTest {
java
}
javaxTest {
java
compileClasspath += javax.output + javax.compileClasspath + commonTest.output + commonTest.runtimeClasspath + common.output
runtimeClasspath = compileClasspath
}
jakartaTest {
java
compileClasspath += jakarta.output + jakarta.compileClasspath + commonTest.output + commonTest.runtimeClasspath + common.output
runtimeClasspath = compileClasspath
}
}

tasks.register('sourceJar', Jar).configure {
from(
sourceSets.common.allJava,
sourceSets.javax.allJava,
sourceSets.jakarta.allJava
)
from sourceSets.main.allJava
}

// do not move this higher - sourceJar must be registered before we apply common.gradle
apply from: '../common.gradle'

compileJava.dependsOn(compileCommonJava, compileJavaxJava, compileJakartaJava)

// Separated Javax / Jakarta tests -------------------------------------------------------------------------------------

compileJakartaJava {
// set the compiler for the `jakarta` sourceSet to Java17
javaCompiler.set(
javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
)
}

compileJakartaTestJava {
// set the compiler for the `jakartaTest` sourceSet to Java17
javaCompiler.set(
javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
)
}

testClasses.dependsOn(javaxTestClasses, jakartaTestClasses)

tasks.register('testJakarta', Test) {
testClassesDirs = sourceSets.jakartaTest.output.classesDirs
classpath = sourceSets.jakartaTest.output.classesDirs + sourceSets.jakartaTest.runtimeClasspath
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
)

dependsOn(jakartaTestClasses)
}

tasks.register('testJavax', Test) {
testClassesDirs = sourceSets.javaxTest.output.classesDirs
classpath = sourceSets.javaxTest.output.classesDirs + sourceSets.javaxTest.runtimeClasspath
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(8)
}
)

dependsOn(javaxTestClasses)
}

test.dependsOn(testJakarta, testJavax)

dependencies {
compileCommon project(':bugsnag')

compileCommon "ch.qos.logback:logback-core:${logbackVersion}"
compileCommon "org.slf4j:slf4j-api:${slf4jApiVersion}"

compileJavax "javax.servlet:javax.servlet-api:${javaxServletApiVersion}"
compileJavax "org.springframework:spring-webmvc:${javaxSpringVersion}"
compileJavax "org.springframework.boot:spring-boot:${javaxSpringBootVersion}"
compileJavax "org.springframework:spring-aop:${javaxSpringVersion}"

compileJakarta "jakarta.servlet:jakarta.servlet-api:${jakartaServletApiVersion}"
compileJakarta "org.springframework:spring-webmvc:${jakartaSpringVersion}"
compileJakarta "org.springframework.boot:spring-boot:${jakartaSpringBootVersion}"
compileJakarta "org.springframework:spring-aop:${jakartaSpringVersion}"


commonTestImplementation project(':bugsnag').sourceSets.test.output
commonTestImplementation project(':bugsnag')

commonTestImplementation "junit:junit:${junitVersion}"

commonTestCompileOnly "org.mockito:mockito-core:2.10.0"

jakartaTestImplementation "org.mockito:mockito-core:${mockitoVersion}"
jakartaTestImplementation "jakarta.servlet:jakarta.servlet-api:${jakartaServletApiVersion}"
jakartaTestImplementation "org.springframework.boot:spring-boot-starter-test:${jakartaSpringBootVersion}"
jakartaTestImplementation "org.springframework.boot:spring-boot-starter-web:${jakartaSpringBootVersion}"
jakartaTestImplementation "org.springframework:spring-aop:${jakartaSpringVersion}"

javaxTestImplementation "org.mockito:mockito-core:2.10.0"
javaxTestImplementation "javax.servlet:javax.servlet-api:${javaxServletApiVersion}"
javaxTestImplementation "org.springframework.boot:spring-boot-starter-test:${javaxSpringBootVersion}"
javaxTestImplementation "org.springframework.boot:spring-boot-starter-web:${javaxSpringBootVersion}"
javaxTestImplementation "org.springframework:spring-aop:${javaxSpringVersion}"
}

dependencies {
// ensure that the published .pom file includes a dependency on com.bugsnag:bugsnag
// this 'api' dependency has no impact on the compilation of this projects source,
// so we keep it in it's own dependencies block
api project(':bugsnag')
}

// here is where we merge all of the class outputs into the default classes directory doing this as its own step avoids
// circular dependencies between the sourceSets and their output directories (if they all use 'main.output.classesDirs'
// then jakarta+javax both depend on it as well)
tasks.register('mergeClasses', Copy) {
from sourceSets.common.output.classesDirs
from sourceSets.jakarta.output.classesDirs
from sourceSets.javax.output.classesDirs

into sourceSets.main.output.classesDirs.asPath
}

classes.dependsOn('mergeClasses')

if (project.hasProperty('releasing')) {
publishing {
publications {
Publication(MavenPublication) {
// this is vital: we use the version details from the "javax" side of the project
// this ensures that Gradle considers that as the baseline set of required versions
// allowing old projects that still use Java8 and the javax.servlet packages to use
// bugsnag-java without any secondary artifacts
versionMapping {
usage('java-api') {
fromResolutionOf('compileCommon')
}
usage('java-runtime') {
fromResolutionOf('compileCommon')
}
}
}
}
}
}
implementation project(':bugsnag')

implementation "ch.qos.logback:logback-core:${logbackVersion}"
implementation "org.slf4j:slf4j-api:${slf4jApiVersion}"

implementation "jakarta.servlet:jakarta.servlet-api:${jakartaServletApiVersion}"
implementation "org.springframework:spring-webmvc:${jakartaSpringVersion}"
implementation "org.springframework.boot:spring-boot:${jakartaSpringBootVersion}"
implementation "org.springframework:spring-aop:${jakartaSpringVersion}"

testImplementation project(':bugsnag').sourceSets.test.output
testImplementation project(':bugsnag')
testImplementation "junit:junit:${junitVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${jakartaSpringBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-web:${jakartaSpringBootVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:5.8.2"
testCompileOnly "org.mockito:mockito-core:2.10.0"
}

/** ---- Publishing config ----
* Pulls in publishing+signing rules from the shared release.gradle.
* This will create tasks like:
* :bugsnag:publishMavenJavaPublicationToTestRepository
* :bugsnag:publishMavenJavaPublicationToOssrhStagingRepository
*/
apply from: "${rootProject.projectDir}/release.gradle"
41 changes: 0 additions & 41 deletions bugsnag-spring/javax/build.gradle

This file was deleted.

13 changes: 0 additions & 13 deletions bugsnag-spring/javax/src/test/resources/logback.xml

This file was deleted.

This file was deleted.

Loading