-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
122 lines (102 loc) · 4.55 KB
/
build.gradle
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
plugins {
id 'java'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.github.node-gradle.node' version '3.5.1' // Auto handle NPM
}
group = 'org.plumdev'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
// Test dependencies
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.12.0'
testImplementation 'org.assertj:assertj-core:3.26.3'
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation 'org.springframework:spring-test:6.1.11'
testImplementation 'org.springframework.security:spring-security-test:6.3.1'
testImplementation 'org.springframework.boot:spring-boot-test-autoconfigure:3.3.2'
testImplementation 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
// Spring dependencies
implementation 'org.apache.tomcat.embed:tomcat-embed-core:10.1.26'
implementation 'org.apache.tomcat.embed:tomcat-embed-el:10.1.26'
implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:10.1.26'
implementation 'org.springframework.boot:spring-boot:3.3.2'
implementation 'org.springframework.boot:spring-boot-autoconfigure:3.3.2'
implementation 'org.springframework:spring-context:6.1.11'
implementation 'org.springframework:spring-core:6.1.11'
implementation 'org.springframework:spring-beans:6.1.11'
implementation 'org.springframework:spring-web:6.1.11'
implementation 'org.springframework:spring-webmvc:6.1.11'
implementation 'org.springframework:spring-websocket:6.1.11'
implementation 'org.springframework.data:spring-data-commons:3.3.2'
implementation 'org.springframework.data:spring-data-jpa:3.3.2'
implementation 'org.springframework.data:spring-data-jdbc:3.3.2'
// Spring Security dependencies
implementation 'org.springframework.security:spring-security-core:6.3.1'
implementation 'org.springframework.security:spring-security-web:6.3.1'
implementation 'org.springframework.security:spring-security-config:6.3.1'
// ORM dependencies
implementation 'org.hibernate.orm:hibernate-core:6.5.2.Final'
implementation 'org.hibernate.validator:hibernate-validator:8.0.1.Final'
implementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
implementation 'com.h2database:h2:2.3.230'
implementation 'org.postgresql:postgresql:42.7.3'
implementation 'mysql:mysql-connector-java:8.0.33'
implementation 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
}
test {
jvmArgs("-XX:+EnableDynamicAgentLoading", "-Xshare:off")
useJUnitPlatform()
}
node {
download = true
version = '18.16.1'
npmVersion = '9.5.1'
// when setting both these directories, npm and node will be in separate directories
workDir = file("${buildDir}/nodejs")
npmWorkDir = file("${buildDir}/npm")
}
def npmExec = System.getProperty('os.name').toLowerCase().contains('windows') ? '/npm.cmd' : '/bin/npm'
def nodeExec = System.getProperty('os.name').toLowerCase().contains('windows') ? '/node.exe' : '/bin/node'
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
java {
cleanthat()
prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0'])
.npmExecutable("${tasks.named('npmSetup').get().npmDir.get()}${npmExec}")
.nodeExecutable("${tasks.named('nodeSetup').get().nodeDir.get()}${nodeExec}")
.config(['parser': 'java', 'tabWidth': 4, 'plugins': ['prettier-plugin-java'], 'printWidth': 120])
.npmInstallCache()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
indentWithSpaces(4)
replaceRegex 'Remove empty lines before end of block', '\\n[\\n]+(\\s*})(?=\\n)', '\n$1'
replaceRegex 'Remove trailing empty comment lines.', '\n\\s*\\*(\n\\s*\\*/\n)', '$1'
}
}
// Tasks Configuration
tasks.register("addCommitMsgGitHookOnBuild", Copy) {
from file(".scripts/commit-msg")
into file(".git/hooks")
}
tasks.named('spotlessApply').configure {
dependsOn ('nodeSetup', 'npmSetup')
dependsOn 'addCommitMsgGitHookOnBuild'
}
tasks.named('spotlessCheck').configure {
dependsOn ('nodeSetup', 'npmSetup')
dependsOn 'addCommitMsgGitHookOnBuild'
}