-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle.kts
73 lines (61 loc) · 2.04 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
plugins {
checkstyle
java
jacoco
id("org.springframework.boot") version "3.4.0"
id("io.spring.dependency-management") version "1.1.6"
id("com.github.spotbugs") version "6.0.26"
}
group = "ru.job4j.devops"
version = "1.0.0"
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = "0.8".toBigDecimal()
}
}
rule {
isEnabled = false
element = "CLASS"
includes = listOf("org.gradle.*")
limit {
counter = "LINE"
value = "TOTALCOUNT"
maximum = "0.3".toBigDecimal()
}
}
}
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.36")
annotationProcessor("org.projectlombok:lombok:1.18.36")
implementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.assertj:assertj-core:3.24.2")
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.register<Zip>("zipJavaDoc") {
group = "documentation" // Группа, в которой будет отображаться задача
description = "Packs the generated Javadoc into a zip archive"
dependsOn("javadoc") // Указываем, что задача зависит от выполнения javadoc
from("build/docs/javadoc") // Исходная папка для упаковки
archiveFileName.set("javadoc.zip") // Имя создаваемого архива
destinationDirectory.set(layout.buildDirectory.dir("archives")) // Директория, куда будет сохранен архив
}
tasks.spotbugsMain {
reports.create("html") {
required = true
outputLocation.set(layout.buildDirectory.file("reports/spotbugs/spotbugs.html"))
}
}
tasks.test {
finalizedBy(tasks.spotbugsMain)
}