-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
137 lines (119 loc) · 4.57 KB
/
build.gradle.kts
File metadata and controls
137 lines (119 loc) · 4.57 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
plugins {
application
checkstyle
jacoco
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.github.ben-manes.versions") version "0.52.0"
id("org.springframework.boot") version "3.5.6"
id("org.springdoc.openapi-gradle-plugin") version "1.9.0"
id("io.spring.dependency-management") version "1.1.7"
id("org.sonarqube") version "7.0.1.6134"
id("io.sentry.jvm.gradle") version "5.12.2"
}
group = "hexlet.code"
version = "0.0.1-SNAPSHOT"
description = "Project for Spring Boot"
application {
mainClass = "hexlet.code.AppApplication"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
val datafakerVer = "2.5.3"
val lombokVer = "1.18.38"
val webMVCuiVer = "2.8.13"
val jacksonNullableVer = "0.2.6"
val mapstructVer = "1.5.5.Final"
val HikariCPVer = "6.3.0"
val postgresqlVer = "42.7.7"
val lmMapstructBndVer = "0.2.0"
val assertjVer = "4.1.1"
val instancioVer = "5.5.1"
dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springframework.boot:spring-boot-devtools")
//
implementation("net.datafaker:datafaker:$datafakerVer")
// SpringDoc OpenAPI Starter WebMVC UI
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$webMVCuiVer")
// модуль jackson-databind-nullable
implementation("org.openapitools:jackson-databind-nullable:$jacksonNullableVer")
// Mapstruct
implementation("org.mapstruct:mapstruct:$mapstructVer")
// DataBase section
implementation("com.zaxxer:HikariCP:$HikariCPVer")
runtimeOnly("com.h2database:h2") // database H2 & HikariCP
implementation("org.postgresql:postgresql:$postgresqlVer")
// конфиг Mapstruct не работает с классами, в которых используется lombok
// https://ru.stackoverflow.com/questions/1286369
compileOnly("org.projectlombok:lombok:$lombokVer")
compileOnly("org.mapstruct:mapstruct:$mapstructVer")
annotationProcessor("org.projectlombok:lombok-mapstruct-binding:$lmMapstructBndVer")
annotationProcessor("org.mapstruct:mapstruct-processor:$mapstructVer")
annotationProcessor("org.projectlombok:lombok:$lombokVer")
// *** Tests ***
testCompileOnly("org.projectlombok:lombok:$lombokVer")
testAnnotationProcessor("org.projectlombok:lombok:$lombokVer")
testAnnotationProcessor("org.mapstruct:mapstruct-processor:$mapstructVer")
//
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// стартёр тестов
testImplementation("org.springframework.boot:spring-boot-starter-test")
// для аутентификации
testImplementation("org.springframework.security:spring-security-test")
// test JSON struct
testImplementation("net.javacrumbs.json-unit:json-unit-assertj:$assertjVer")
// Instacio
testImplementation("org.instancio:instancio-junit:$instancioVer")
}
checkstyle {
toolVersion = "10.26.1"
configFile = file("config/checkstyle/checkstyle.xml")
}
jacoco {
toolVersion = "0.8.12"
}
tasks.jacocoTestReport {
reports {
xml.required = true
}
}
//tasks.withType<JavaCompile>() {
// // "--warning-mode all",
// options.compilerArgs.addAll(listOf("-Xlint:deprecation", "-Xlint:unchecked"))
//}
tasks.withType<Test> {
useJUnitPlatform()
}
sentry {
// Generates a JVM (Java, Kotlin, etc.) source bundle and uploads your source code to Sentry.
// This enables source context, allowing you to see your source
// code as part of your stack traces in Sentry.
includeSourceContext = true
org = "sprojects-fj"
projectName = "java-project-99"
authToken = System.getenv("SENTRY_AUTH_TOKEN")
}
tasks.sentryBundleSourcesJava {
enabled = System.getenv("SENTRY_AUTH_TOKEN") != null
}
sonar {
properties {
property("sonar.projectKey", "VictorGotsenko_java-project-99")
property("sonar.organization", "victorgotsenko")
property("sonar.host.url", "https://sonarcloud.io")
// property("sonar.log.level", "TRACE")
// Отключаем проверку зависимостей
property("sonar.dependencyVerification.enabled", "false")
}
}