|
| 1 | +import org.jetbrains.kotlin.config.KotlinCompilerVersion |
| 2 | +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| 3 | + |
| 4 | +plugins { |
| 5 | + alias(libs.plugins.springboot4) |
| 6 | + alias(libs.plugins.spring.dependency.management) |
| 7 | + alias(libs.plugins.kotlin.jvm) |
| 8 | + alias(libs.plugins.kotlin.spring) |
| 9 | + id("io.sentry.systemtest") |
| 10 | +} |
| 11 | + |
| 12 | +group = "io.sentry.sample.spring-boot-4-log4j2" |
| 13 | + |
| 14 | +version = "0.0.1-SNAPSHOT" |
| 15 | + |
| 16 | +java.sourceCompatibility = JavaVersion.VERSION_17 |
| 17 | + |
| 18 | +java.targetCompatibility = JavaVersion.VERSION_17 |
| 19 | + |
| 20 | +configure<JavaPluginExtension> { |
| 21 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 22 | + targetCompatibility = JavaVersion.VERSION_17 |
| 23 | +} |
| 24 | + |
| 25 | +tasks.withType<KotlinCompile>().configureEach { |
| 26 | + kotlin { |
| 27 | + explicitApi() |
| 28 | + // skip metadata version check, as Spring 7 / Spring Boot 4 is |
| 29 | + // compiled against a newer version of Kotlin |
| 30 | + compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") |
| 31 | + compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 |
| 32 | + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 |
| 33 | + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +dependencies { |
| 38 | + implementation(libs.springboot4.starter) |
| 39 | + implementation(libs.springboot4.starter.actuator) |
| 40 | + implementation(libs.springboot4.starter.aspectj) |
| 41 | + implementation(libs.springboot4.starter.graphql) |
| 42 | + implementation(libs.springboot4.starter.jdbc) |
| 43 | + implementation(libs.springboot4.starter.quartz) |
| 44 | + implementation(libs.springboot4.starter.security) |
| 45 | + implementation(libs.springboot4.starter.web) |
| 46 | + implementation(libs.springboot4.starter.webflux) |
| 47 | + implementation(libs.springboot4.starter.websocket) |
| 48 | + implementation(libs.springboot4.starter.restclient) |
| 49 | + implementation(libs.springboot4.starter.webclient) |
| 50 | + implementation(Config.Libs.aspectj) |
| 51 | + implementation(Config.Libs.kotlinReflect) |
| 52 | + implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION)) |
| 53 | + implementation(projects.sentrySpringBoot4Starter) |
| 54 | + implementation(projects.sentryGraphql22) |
| 55 | + implementation(projects.sentryQuartz) |
| 56 | + implementation(projects.sentryAsyncProfiler) |
| 57 | + |
| 58 | + implementation(projects.sentryLog4j2) |
| 59 | + implementation("org.springframework.boot:spring-boot-starter-log4j2") |
| 60 | + modules { |
| 61 | + module("org.springframework.boot:spring-boot-starter-logging") { |
| 62 | + replacedBy( |
| 63 | + "org.springframework.boot:spring-boot-starter-log4j2", |
| 64 | + "Use Log4j2 instead of Logback", |
| 65 | + ) |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + // cache tracing |
| 70 | + implementation(libs.springboot4.starter.cache) |
| 71 | + implementation(libs.caffeine) |
| 72 | + |
| 73 | + // kafka |
| 74 | + implementation(libs.springboot4.starter.kafka) |
| 75 | + implementation(projects.sentryKafka) |
| 76 | + |
| 77 | + // database query tracing |
| 78 | + implementation(projects.sentryJdbc) |
| 79 | + runtimeOnly(libs.hsqldb) |
| 80 | + |
| 81 | + testImplementation(kotlin(Config.kotlinStdLib)) |
| 82 | + testImplementation(projects.sentry) |
| 83 | + testImplementation(projects.sentrySystemTestSupport) |
| 84 | + testImplementation(libs.apollo3.kotlin) |
| 85 | + testImplementation(libs.kotlin.test.junit) |
| 86 | + testImplementation(libs.slf4j2.api) |
| 87 | + testImplementation(libs.springboot4.starter.test) { |
| 88 | + exclude(group = "org.junit.vintage", module = "junit-vintage-engine") |
| 89 | + } |
| 90 | +} |
| 91 | + |
| 92 | +tasks.register<Test>("systemTest").configure { |
| 93 | + group = "verification" |
| 94 | + description = "Runs the System tests" |
| 95 | + |
| 96 | + val test = project.extensions.getByType<SourceSetContainer>()["test"] |
| 97 | + testClassesDirs = test.output.classesDirs |
| 98 | + classpath = test.runtimeClasspath |
| 99 | + |
| 100 | + maxParallelForks = 1 |
| 101 | + |
| 102 | + // Cap JVM args per test |
| 103 | + minHeapSize = "128m" |
| 104 | + maxHeapSize = "1g" |
| 105 | + |
| 106 | + filter { includeTestsMatching("io.sentry.systemtest*") } |
| 107 | +} |
| 108 | + |
| 109 | +tasks.named("test").configure { |
| 110 | + require(this is Test) |
| 111 | + |
| 112 | + filter { excludeTestsMatching("io.sentry.systemtest.*") } |
| 113 | +} |
0 commit comments