-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
164 lines (139 loc) · 4.49 KB
/
build.gradle
File metadata and controls
164 lines (139 loc) · 4.49 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
plugins {
id 'application'
id 'checkstyle'
id 'jacoco'
id 'org.springframework.boot' version '2.5.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'com.adarshr.test-logger' version '2.1.1'
id 'com.github.ben-manes.versions' version '0.38.0'
id 'org.liquibase.gradle' version '2.0.4'
// Плагины для openapi
id 'com.github.johnrengelman.processes' version '0.5.0'
id 'org.springdoc.openapi-gradle-plugin' version '1.3.3'
// Сборщик фронтенда
id 'org.siouan.frontend-jdk11' version '6.0.0'
}
group = 'hexlet.code'
application {
mainClass = 'hexlet.code.AppApplication'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor(
'org.projectlombok:lombok:1.18.22',
'com.querydsl:querydsl-apt:5.0.0:jpa',
'javax.annotation:javax.annotation-api:1.3.2',
'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final'
)
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation(
'org.springframework.boot:spring-boot-starter-data-jpa',
'org.springframework.boot:spring-boot-starter-web',
'org.springframework.boot:spring-boot-starter-actuator',
'org.springframework.boot:spring-boot-starter-validation',
'org.springframework.boot:spring-boot-starter-security',
'io.jsonwebtoken:jjwt:0.9.1',
'org.springdoc:springdoc-openapi-ui:1.5.12',
'org.liquibase:liquibase-core:4.6.1',
'com.querydsl:querydsl-core:5.0.0',
'com.querydsl:querydsl-jpa:5.0.0',
'com.rollbar:rollbar-spring-boot-webmvc:1.8.1',
)
liquibaseRuntime(
sourceSets.main.output,
'org.liquibase:liquibase-core:4.6.1',
'org.liquibase.ext:liquibase-hibernate5:4.5.0',
'org.springframework.boot:spring-boot-starter-data-jpa'
)
runtimeOnly (
'com.h2database:h2:1.4.200',
'org.postgresql:postgresql:42.2.24'
)
testImplementation(
'org.springframework.boot:spring-boot-starter-security:3.0.1',
'org.springframework.security:spring-security-test:5.5.1',
'org.springframework.boot:spring-boot-starter-test',
'com.tobedevoured.modelcitizen:spring:0.8.3',
'com.github.database-rider:rider-junit5:1.32.0',
'org.assertj:assertj-core:3.11.1'
)
}
task stage(dependsOn: [clean, installDist])
installDist.mustRunAfter clean
wrapper {
gradleVersion = '7.4'
distributionType = Wrapper.DistributionType.ALL
}
compileJava {
options.release = 17
options.encoding = 'UTF-8'
}
test {
useJUnitPlatform()
}
// Настраиваем таску diffChangeLog таким образом,
// чтобы миграции учитывали изменения в моделях
diffChangeLog {
dependsOn compileJava
}
// Настраиваем Liquibase
liquibase {
activities {
main {
// Указываем путь, по которому будет сгенерирован файл миграции
changeLogFile 'src/main/resources/db/changelog/changelog-master.xml'
// Указывем источник, с которым будут сравниваться изменения
// Это база данных, изначально она пустая
url 'jdbc:h2:./taskManager'
// Имя пользователя и пароль для подключения к базе
username 'sa'
password ''
// Сравниваем с моделями, задавая пакет
referenceUrl 'hibernate:spring:hexlet.code.model' +
// Указываем диалект
'?dialect=org.hibernate.dialect.H2Dialect' +
// Указываем правила именования таблиц и столбцов,
// чтобы они соответствовали правилам Spring
'&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy'
}
}
}
jacocoTestReport {
reports {
xml.required = true
}
}
test {
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
}
//frontend
frontend {
nodeVersion = '16.13.1'
installScript = 'install'
assembleScript = 'run build'
packageJsonDirectory = file("${projectDir}/frontend")
}
def configFrontendTasks = {
inputs.files(fileTree("$projectDir/frontend").exclude('build', 'node_modules'))
outputs.dir("$buildDir/resources/main/static")
}
assembleFrontend {
configure configFrontendTasks
doLast {
copy {
from "$projectDir/frontend/build"
into "$buildDir/resources/main/static"
}
}
}
installFrontend {
configure configFrontendTasks
}
processResources.dependsOn assembleFrontend