|
1 |
| -import org.jetbrains.kotlin.config.KotlinCompilerVersion |
2 | 1 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
3 | 2 | import org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
|
4 | 3 |
|
5 | 4 | plugins {
|
6 |
| - alias(libs.plugins.springboot2) apply false |
7 |
| - alias(libs.plugins.spring.dependency.management) |
8 |
| - alias(libs.plugins.kotlin.jvm) |
9 |
| - alias(libs.plugins.kotlin.spring) |
10 |
| - id("war") |
11 |
| - alias(libs.plugins.gretty) |
| 5 | + application |
| 6 | + alias(libs.plugins.springboot2) apply false |
| 7 | + alias(libs.plugins.spring.dependency.management) |
| 8 | + alias(libs.plugins.kotlin.jvm) |
| 9 | + alias(libs.plugins.kotlin.spring) |
| 10 | + id("war") |
| 11 | + alias(libs.plugins.gretty) |
12 | 12 | }
|
13 | 13 |
|
| 14 | +application { mainClass.set("io.sentry.samples.spring.Main") } |
| 15 | + |
| 16 | +// Ensure WAR is up to date before run task |
| 17 | +tasks.named("run") { dependsOn(tasks.named("war")) } |
| 18 | + |
14 | 19 | group = "io.sentry.sample.spring"
|
| 20 | + |
15 | 21 | version = "0.0.1-SNAPSHOT"
|
16 | 22 |
|
17 | 23 | java {
|
18 |
| - sourceCompatibility = JavaVersion.VERSION_1_8 |
19 |
| - targetCompatibility = JavaVersion.VERSION_1_8 |
| 24 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 25 | + targetCompatibility = JavaVersion.VERSION_1_8 |
20 | 26 | }
|
21 | 27 |
|
22 |
| -spotless { |
23 |
| - kotlinGradle { |
24 |
| - // This file throws an unclear error |
25 |
| - targetExclude("build.gradle.kts") |
26 |
| - } |
27 |
| -} |
28 |
| - |
29 |
| -repositories { |
30 |
| - mavenCentral() |
31 |
| -} |
| 28 | +repositories { mavenCentral() } |
32 | 29 |
|
33 | 30 | dependencyManagement {
|
34 |
| - imports { |
35 |
| - mavenBom(BOM_COORDINATES) |
36 |
| - } |
| 31 | + imports { |
| 32 | + mavenBom(BOM_COORDINATES) |
| 33 | + mavenBom(libs.kotlin.bom.get().toString()) |
| 34 | + mavenBom(libs.jackson.bom.get().toString()) |
| 35 | + } |
37 | 36 | }
|
38 | 37 |
|
39 | 38 | dependencies {
|
40 |
| - implementation(Config.Libs.springWeb) |
41 |
| - implementation(Config.Libs.springAop) |
42 |
| - implementation(Config.Libs.aspectj) |
43 |
| - implementation(Config.Libs.springSecurityWeb) |
44 |
| - implementation(Config.Libs.springSecurityConfig) |
45 |
| - implementation(Config.Libs.kotlinReflect) |
46 |
| - implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION)) |
47 |
| - implementation(projects.sentrySpring) |
48 |
| - implementation(projects.sentryLogback) |
49 |
| - implementation(libs.logback.classic) |
50 |
| - implementation(libs.servlet.api) |
51 |
| - testImplementation(libs.springboot.starter.test) { |
52 |
| - exclude(group = "org.junit.vintage", module = "junit-vintage-engine") |
53 |
| - } |
54 |
| -} |
| 39 | + implementation(Config.Libs.springWeb) |
| 40 | + implementation(Config.Libs.springAop) |
| 41 | + implementation(Config.Libs.aspectj) |
| 42 | + implementation(Config.Libs.springSecurityWeb) |
| 43 | + implementation(Config.Libs.springSecurityConfig) |
| 44 | + implementation(Config.Libs.kotlinReflect) |
| 45 | + implementation(kotlin(Config.kotlinStdLib)) |
| 46 | + implementation(projects.sentrySpring) |
| 47 | + implementation(projects.sentryLogback) |
| 48 | + implementation(libs.jackson.databind) |
| 49 | + implementation(libs.logback.classic) |
| 50 | + implementation(libs.servlet.api) |
55 | 51 |
|
56 |
| -tasks.withType<Test>().configureEach { |
57 |
| - useJUnitPlatform() |
| 52 | + implementation(libs.tomcat.catalina) |
| 53 | + implementation(libs.tomcat.embed.jasper) |
| 54 | + |
| 55 | + testImplementation(projects.sentrySystemTestSupport) |
| 56 | + testImplementation(libs.kotlin.test.junit) |
| 57 | + testImplementation(libs.springboot.starter.test) { |
| 58 | + exclude(group = "org.junit.vintage", module = "junit-vintage-engine") |
| 59 | + } |
58 | 60 | }
|
59 | 61 |
|
60 | 62 | tasks.withType<KotlinCompile>().configureEach {
|
61 |
| - kotlin { |
62 |
| - compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict") |
63 |
| - compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 |
64 |
| - } |
| 63 | + kotlin { |
| 64 | + compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict") |
| 65 | + compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 |
| 66 | + } |
| 67 | +} |
| 68 | + |
| 69 | +configure<SourceSetContainer> { test { java.srcDir("src/test/java") } } |
| 70 | + |
| 71 | +tasks.register<Test>("systemTest").configure { |
| 72 | + group = "verification" |
| 73 | + description = "Runs the System tests" |
| 74 | + |
| 75 | + outputs.upToDateWhen { false } |
| 76 | + |
| 77 | + maxParallelForks = 1 |
| 78 | + |
| 79 | + // Cap JVM args per test |
| 80 | + minHeapSize = "128m" |
| 81 | + maxHeapSize = "1g" |
| 82 | + |
| 83 | + filter { includeTestsMatching("io.sentry.systemtest*") } |
| 84 | +} |
| 85 | + |
| 86 | +tasks.named("test").configure { |
| 87 | + require(this is Test) |
| 88 | + |
| 89 | + filter { excludeTestsMatching("io.sentry.systemtest.*") } |
65 | 90 | }
|
0 commit comments