-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle.kts
124 lines (100 loc) · 3.02 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import java.time.Duration
plugins {
java
pmd
jacoco
id("org.springframework.boot") version "3.2.5"
id("io.spring.dependency-management") version "1.1.4"
id("org.springdoc.openapi-gradle-plugin") version "1.8.0"
id("org.sonarqube") version "5.0.0.4638"
}
group = "com.wcc.cms"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_21
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
val testContainer = "1.19.0"
dependencies {
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.surrealdb:surrealdb-driver:0.1.0")
implementation("org.java-websocket:Java-WebSocket:1.5.7")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.skyscreamer:jsonassert:1.5.3")
testImplementation("com.surrealdb:surrealdb-driver:0.1.0")
testImplementation("org.testcontainers:testcontainers:${testContainer}")
testImplementation("org.testcontainers:junit-jupiter:$testContainer")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
}
tasks.withType<Test> {
useJUnitPlatform()
jvmArgs = listOf("-Xmx2048m")
timeout.set(Duration.ofMinutes(2))
}
tasks {
jacocoTestCoverageVerification {
violationRules {
rule { limit { minimum = BigDecimal.valueOf(0.7) } }
}
}
check {
dependsOn(jacocoTestCoverageVerification)
}
}
tasks.withType<Pmd> {
reports {
xml.required.set(true)
html.required.set(true)
}
doFirst {
println("Running PMD...")
}
doLast {
println("PMD completed.")
}
}
pmd {
toolVersion = "7.3.0"
isConsoleOutput = true
ruleSets = listOf()
ruleSetFiles = files("config/pmd/custom-ruleset.xml")
}
val baseDir = project.projectDir
tasks.named<Pmd>("pmdMain") {
exclude("**/FileUtil.java")
exclude("**/PlatformApplication.java")
}
tasks.named<Pmd>("pmdTest") {
ruleSetFiles = files("config/pmd/custom-ruleset-test.xml")
}
tasks.register("sonarQubeAnalysis") {
group = "Code Quality"
description = "Runs sonarQube analysis on the project."
dependsOn("test")
finalizedBy("sonarqube")
}
if (project.hasProperty("localProfile")) {
apply(plugin = "org.sonarqube")
sonarqube {
properties {
property("sonar.projectKey", "wcc-backend")
property("sonar.projectName", "wcc-backend")
property("sonar.host.url", "http://localhost:9000")
property("sonar.token", "PLACE_YOUR_TOKEN_HERE")
}
}
}
logging.captureStandardOutput(LogLevel.INFO)