Skip to content

Commit

Permalink
Move sentry-spring-boot-starter to sentry-spring-boot module and have…
Browse files Browse the repository at this point in the history
… sentry-spring-boot-starter bring spring-boot-starter
  • Loading branch information
adinauer committed Aug 3, 2023
1 parent fb296f0 commit 28c3064
Show file tree
Hide file tree
Showing 53 changed files with 351 additions and 196 deletions.
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ targets:
maven:io.sentry:sentry:
maven:io.sentry:sentry-spring:
maven:io.sentry:sentry-spring-jakarta:
#maven:io.sentry:sentry-spring-boot:
#maven:io.sentry:sentry-spring-boot-jakarta:
maven:io.sentry:sentry-spring-boot-starter:
maven:io.sentry:sentry-spring-boot-starter-jakarta:
maven:io.sentry:sentry-servlet:
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ body:
- sentry-opentelemetry-core
- sentry-servlet
- sentry-servlet-jakarta
- sentry-spring-boot
- sentry-spring-boot-jakarta
- sentry-spring-boot-starter
- sentry-spring-boot-starter-jakarta
- sentry-spring
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Sentry SDK for Java and Android
| sentry-kotlin-extensions | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-extensions/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-extensions) | 14 |
| sentry-servlet | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-servlet/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-servlet) | |
| sentry-servlet-jakarta | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-servlet-jakarta/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-servlet-jakarta) | |
| sentry-spring-boot | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot) |
| sentry-spring-boot-jakarta | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot-jakarta/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot-jakarta) |
| sentry-spring-boot-starter | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot-starter/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot-starter) |
| sentry-spring-boot-starter-jakarta | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot-starter-jakarta/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring-boot-starter-jakarta) |
| sentry-spring | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-spring) |
Expand Down
1 change: 1 addition & 0 deletions sentry-spring-boot-jakarta/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
57 changes: 57 additions & 0 deletions sentry-spring-boot-jakarta/api/sentry-spring-boot-jakarta.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
public final class io/sentry/spring/boot/jakarta/BuildConfig {
public static final field SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME Ljava/lang/String;
public static final field VERSION_NAME Ljava/lang/String;
}

public class io/sentry/spring/boot/jakarta/InAppIncludesResolver : org/springframework/context/ApplicationContextAware {
public fun <init> ()V
public fun resolveInAppIncludes ()Ljava/util/List;
public fun setApplicationContext (Lorg/springframework/context/ApplicationContext;)V
}

public class io/sentry/spring/boot/jakarta/SentryAutoConfiguration {
public fun <init> ()V
}

public class io/sentry/spring/boot/jakarta/SentryLogbackAppenderAutoConfiguration {
public fun <init> ()V
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/jakarta/SentryProperties;)Lio/sentry/spring/boot/jakarta/SentryLogbackInitializer;
}

public class io/sentry/spring/boot/jakarta/SentryProperties : io/sentry/SentryOptions {
public fun <init> ()V
public fun getExceptionResolverOrder ()I
public fun getLogging ()Lio/sentry/spring/boot/jakarta/SentryProperties$Logging;
public fun getReactive ()Lio/sentry/spring/boot/jakarta/SentryProperties$Reactive;
public fun getUserFilterOrder ()Ljava/lang/Integer;
public fun isUseGitCommitIdAsRelease ()Z
public fun setExceptionResolverOrder (I)V
public fun setLogging (Lio/sentry/spring/boot/jakarta/SentryProperties$Logging;)V
public fun setReactive (Lio/sentry/spring/boot/jakarta/SentryProperties$Reactive;)V
public fun setUseGitCommitIdAsRelease (Z)V
public fun setUserFilterOrder (Ljava/lang/Integer;)V
}

public class io/sentry/spring/boot/jakarta/SentryProperties$Logging {
public fun <init> ()V
public fun getLoggers ()Ljava/util/List;
public fun getMinimumBreadcrumbLevel ()Lorg/slf4j/event/Level;
public fun getMinimumEventLevel ()Lorg/slf4j/event/Level;
public fun isEnabled ()Z
public fun setEnabled (Z)V
public fun setLoggers (Ljava/util/List;)V
public fun setMinimumBreadcrumbLevel (Lorg/slf4j/event/Level;)V
public fun setMinimumEventLevel (Lorg/slf4j/event/Level;)V
}

public class io/sentry/spring/boot/jakarta/SentryProperties$Reactive {
public fun <init> ()V
public fun isThreadLocalAccessorEnabled ()Z
public fun setThreadLocalAccessorEnabled (Z)V
}

public class io/sentry/spring/boot/jakarta/SentryWebfluxAutoConfiguration {
public fun <init> ()V
public fun sentryWebExceptionHandler (Lio/sentry/IHub;)Lio/sentry/spring/jakarta/webflux/SentryWebExceptionHandler;
}

117 changes: 117 additions & 0 deletions sentry-spring-boot-jakarta/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import net.ltgt.gradle.errorprone.errorprone
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
`java-library`
kotlin("jvm")
jacoco
id(Config.QualityPlugins.errorProne)
id(Config.QualityPlugins.gradleVersions)
id(Config.BuildPlugins.buildConfig) version Config.BuildPlugins.buildConfigVersion
id(Config.BuildPlugins.springBoot) version Config.springBoot3Version apply false
}

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion
}

dependencies {
api(projects.sentry)
api(projects.sentrySpringJakarta)
compileOnly(projects.sentryLogback)
compileOnly(projects.sentryApacheHttpClient5)
compileOnly(Config.Libs.springBoot3Starter)
compileOnly(platform(SpringBootPlugin.BOM_COORDINATES))
compileOnly(projects.sentryGraphql)
compileOnly(Config.Libs.springWeb)
compileOnly(Config.Libs.springWebflux)
compileOnly(Config.Libs.servletApiJakarta)
compileOnly(Config.Libs.springBoot3StarterAop)
compileOnly(Config.Libs.springBoot3StarterSecurity)
compileOnly(Config.Libs.springBoot3StarterGraphql)
compileOnly(Config.Libs.reactorCore)
compileOnly(Config.Libs.contextPropagation)
compileOnly(projects.sentryOpentelemetry.sentryOpentelemetryCore)

annotationProcessor(platform(SpringBootPlugin.BOM_COORDINATES))
annotationProcessor(Config.AnnotationProcessors.springBootAutoConfigure)
annotationProcessor(Config.AnnotationProcessors.springBootConfiguration)

compileOnly(Config.CompileOnly.nopen)
errorprone(Config.CompileOnly.nopenChecker)
errorprone(Config.CompileOnly.errorprone)
errorprone(Config.CompileOnly.errorProneNullAway)
compileOnly(Config.CompileOnly.jetbrainsAnnotations)

// tests
testImplementation(projects.sentryLogback)
testImplementation(projects.sentryApacheHttpClient5)
testImplementation(projects.sentryTestSupport)
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(Config.TestLibs.kotlinTestJunit)
testImplementation(Config.TestLibs.mockitoKotlin)
testImplementation(Config.TestLibs.mockWebserver)

testImplementation(Config.Libs.okhttp)
testImplementation(Config.Libs.springBoot3Starter)
testImplementation(platform(SpringBootPlugin.BOM_COORDINATES))
testImplementation(Config.Libs.springBoot3StarterTest)
testImplementation(Config.Libs.springBoot3StarterWeb)
testImplementation(Config.Libs.springBoot3StarterWebflux)
testImplementation(Config.Libs.springBoot3StarterSecurity)
testImplementation(Config.Libs.springBoot3StarterAop)
testImplementation(projects.sentryOpentelemetry.sentryOpentelemetryCore)
testImplementation(Config.Libs.contextPropagation)
}

configure<SourceSetContainer> {
test {
java.srcDir("src/test/java")
}
}

jacoco {
toolVersion = Config.QualityPlugins.Jacoco.version
}

tasks.jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(false)
}
}

tasks {
jacocoTestCoverageVerification {
violationRules {
rule { limit { minimum = Config.QualityPlugins.Jacoco.minimumCoverage } }
}
}
check {
dependsOn(jacocoTestCoverageVerification)
dependsOn(jacocoTestReport)
}
}

buildConfig {
useJavaOutput()
packageName("io.sentry.spring.boot.jakarta")
buildConfigField("String", "SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME", "\"${Config.Sentry.SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME}\"")
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}

val generateBuildConfig by tasks
tasks.withType<JavaCompile>().configureEach {
dependsOn(generateBuildConfig)
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
}
}
Original file line number Diff line number Diff line change
@@ -1,57 +0,0 @@
public final class io/sentry/spring/boot/jakarta/BuildConfig {
public static final field SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME Ljava/lang/String;
public static final field VERSION_NAME Ljava/lang/String;
}

public class io/sentry/spring/boot/jakarta/InAppIncludesResolver : org/springframework/context/ApplicationContextAware {
public fun <init> ()V
public fun resolveInAppIncludes ()Ljava/util/List;
public fun setApplicationContext (Lorg/springframework/context/ApplicationContext;)V
}

public class io/sentry/spring/boot/jakarta/SentryAutoConfiguration {
public fun <init> ()V
}

public class io/sentry/spring/boot/jakarta/SentryLogbackAppenderAutoConfiguration {
public fun <init> ()V
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/jakarta/SentryProperties;)Lio/sentry/spring/boot/jakarta/SentryLogbackInitializer;
}

public class io/sentry/spring/boot/jakarta/SentryProperties : io/sentry/SentryOptions {
public fun <init> ()V
public fun getExceptionResolverOrder ()I
public fun getLogging ()Lio/sentry/spring/boot/jakarta/SentryProperties$Logging;
public fun getReactive ()Lio/sentry/spring/boot/jakarta/SentryProperties$Reactive;
public fun getUserFilterOrder ()Ljava/lang/Integer;
public fun isUseGitCommitIdAsRelease ()Z
public fun setExceptionResolverOrder (I)V
public fun setLogging (Lio/sentry/spring/boot/jakarta/SentryProperties$Logging;)V
public fun setReactive (Lio/sentry/spring/boot/jakarta/SentryProperties$Reactive;)V
public fun setUseGitCommitIdAsRelease (Z)V
public fun setUserFilterOrder (Ljava/lang/Integer;)V
}

public class io/sentry/spring/boot/jakarta/SentryProperties$Logging {
public fun <init> ()V
public fun getLoggers ()Ljava/util/List;
public fun getMinimumBreadcrumbLevel ()Lorg/slf4j/event/Level;
public fun getMinimumEventLevel ()Lorg/slf4j/event/Level;
public fun isEnabled ()Z
public fun setEnabled (Z)V
public fun setLoggers (Ljava/util/List;)V
public fun setMinimumBreadcrumbLevel (Lorg/slf4j/event/Level;)V
public fun setMinimumEventLevel (Lorg/slf4j/event/Level;)V
}

public class io/sentry/spring/boot/jakarta/SentryProperties$Reactive {
public fun <init> ()V
public fun isThreadLocalAccessorEnabled ()Z
public fun setThreadLocalAccessorEnabled (Z)V
}

public class io/sentry/spring/boot/jakarta/SentryWebfluxAutoConfiguration {
public fun <init> ()V
public fun sentryWebExceptionHandler (Lio/sentry/IHub;)Lio/sentry/spring/jakarta/webflux/SentryWebExceptionHandler;
}

48 changes: 2 additions & 46 deletions sentry-spring-boot-starter-jakarta/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins {
jacoco
id(Config.QualityPlugins.errorProne)
id(Config.QualityPlugins.gradleVersions)
id(Config.BuildPlugins.buildConfig) version Config.BuildPlugins.buildConfigVersion
id(Config.BuildPlugins.springBoot) version Config.springBoot3Version apply false
}

Expand All @@ -23,22 +22,8 @@ tasks.withType<KotlinCompile>().configureEach {
}

dependencies {
api(projects.sentry)
api(projects.sentrySpringJakarta)
compileOnly(projects.sentryLogback)
compileOnly(projects.sentryApacheHttpClient5)
compileOnly(Config.Libs.springBoot3Starter)
compileOnly(platform(SpringBootPlugin.BOM_COORDINATES))
compileOnly(projects.sentryGraphql)
compileOnly(Config.Libs.springWeb)
compileOnly(Config.Libs.springWebflux)
compileOnly(Config.Libs.servletApiJakarta)
compileOnly(Config.Libs.springBoot3StarterAop)
compileOnly(Config.Libs.springBoot3StarterSecurity)
compileOnly(Config.Libs.springBoot3StarterGraphql)
compileOnly(Config.Libs.reactorCore)
compileOnly(Config.Libs.contextPropagation)
compileOnly(projects.sentryOpentelemetry.sentryOpentelemetryCore)
api(projects.sentrySpringBootJakarta)
api(Config.Libs.springBoot3Starter)

annotationProcessor(platform(SpringBootPlugin.BOM_COORDINATES))
annotationProcessor(Config.AnnotationProcessors.springBootAutoConfigure)
Expand All @@ -49,26 +34,6 @@ dependencies {
errorprone(Config.CompileOnly.errorprone)
errorprone(Config.CompileOnly.errorProneNullAway)
compileOnly(Config.CompileOnly.jetbrainsAnnotations)

// tests
testImplementation(projects.sentryLogback)
testImplementation(projects.sentryApacheHttpClient5)
testImplementation(projects.sentryTestSupport)
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(Config.TestLibs.kotlinTestJunit)
testImplementation(Config.TestLibs.mockitoKotlin)
testImplementation(Config.TestLibs.mockWebserver)

testImplementation(Config.Libs.okhttp)
testImplementation(Config.Libs.springBoot3Starter)
testImplementation(platform(SpringBootPlugin.BOM_COORDINATES))
testImplementation(Config.Libs.springBoot3StarterTest)
testImplementation(Config.Libs.springBoot3StarterWeb)
testImplementation(Config.Libs.springBoot3StarterWebflux)
testImplementation(Config.Libs.springBoot3StarterSecurity)
testImplementation(Config.Libs.springBoot3StarterAop)
testImplementation(projects.sentryOpentelemetry.sentryOpentelemetryCore)
testImplementation(Config.Libs.contextPropagation)
}

configure<SourceSetContainer> {
Expand Down Expand Up @@ -100,16 +65,7 @@ tasks {
}
}

buildConfig {
useJavaOutput()
packageName("io.sentry.spring.boot.jakarta")
buildConfigField("String", "SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME", "\"${Config.Sentry.SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME}\"")
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}

val generateBuildConfig by tasks
tasks.withType<JavaCompile>().configureEach {
dependsOn(generateBuildConfig)
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
Expand Down
51 changes: 0 additions & 51 deletions sentry-spring-boot-starter/api/sentry-spring-boot-starter.api
Original file line number Diff line number Diff line change
@@ -1,51 +0,0 @@
public final class io/sentry/spring/boot/BuildConfig {
public static final field SENTRY_SPRING_BOOT_SDK_NAME Ljava/lang/String;
public static final field VERSION_NAME Ljava/lang/String;
}

public class io/sentry/spring/boot/InAppIncludesResolver : org/springframework/context/ApplicationContextAware {
public fun <init> ()V
public fun resolveInAppIncludes ()Ljava/util/List;
public fun setApplicationContext (Lorg/springframework/context/ApplicationContext;)V
}

public class io/sentry/spring/boot/SentryAutoConfiguration {
public fun <init> ()V
}

public class io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration {
public fun <init> ()V
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/SentryProperties;)Lio/sentry/spring/boot/SentryLogbackInitializer;
}

public class io/sentry/spring/boot/SentryProperties : io/sentry/SentryOptions {
public fun <init> ()V
public fun getExceptionResolverOrder ()I
public fun getLogging ()Lio/sentry/spring/boot/SentryProperties$Logging;
public fun getUserFilterOrder ()Ljava/lang/Integer;
public fun isUseGitCommitIdAsRelease ()Z
public fun setExceptionResolverOrder (I)V
public fun setLogging (Lio/sentry/spring/boot/SentryProperties$Logging;)V
public fun setUseGitCommitIdAsRelease (Z)V
public fun setUserFilterOrder (Ljava/lang/Integer;)V
}

public class io/sentry/spring/boot/SentryProperties$Logging {
public fun <init> ()V
public fun getLoggers ()Ljava/util/List;
public fun getMinimumBreadcrumbLevel ()Lorg/slf4j/event/Level;
public fun getMinimumEventLevel ()Lorg/slf4j/event/Level;
public fun isEnabled ()Z
public fun setEnabled (Z)V
public fun setLoggers (Ljava/util/List;)V
public fun setMinimumBreadcrumbLevel (Lorg/slf4j/event/Level;)V
public fun setMinimumEventLevel (Lorg/slf4j/event/Level;)V
}

public class io/sentry/spring/boot/SentryWebfluxAutoConfiguration {
public fun <init> ()V
public fun sentryScheduleHookApplicationRunner ()Lorg/springframework/boot/ApplicationRunner;
public fun sentryWebExceptionHandler (Lio/sentry/IHub;)Lio/sentry/spring/webflux/SentryWebExceptionHandler;
public fun sentryWebFilter (Lio/sentry/IHub;)Lio/sentry/spring/webflux/SentryWebFilter;
}

Loading

0 comments on commit 28c3064

Please sign in to comment.