-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
99 lines (84 loc) · 2.8 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
plugins {
id 'org.springframework.boot' version '3.4.1'
id 'io.spring.dependency-management' version '1.1.7'
id 'java'
// https://github.com/qoomon/gradle-git-versioning-plugin
id 'me.qoomon.git-versioning' version '6.4.4'
// https://github.com/node-gradle/gradle-node-plugin
id "com.github.node-gradle.node" version '7.1.0'
id "io.github.itzg.simple-boot-image" version '3.4.3'
// https://github.com/ben-manes/gradle-versions-plugin
id "com.github.ben-manes.versions" version "0.51.0"
}
version = '0.0.1-SNAPSHOT'
gitVersioning.apply {
refs {
tag('.+') {
version = '${ref}'
}
branch('main') {
version = '${describe.tag}-SNAPSHOT'
}
branch('.+') {
version = '${ref}-SNAPSHOT'
}
}
}
group = 'me.itzg'
java {
sourceCompatibility = JavaVersion.VERSION_21
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
// https://skaffold.dev/docs/pipeline-stages/builders/custom/
test.onlyIf { !System.getenv('SKIP_TESTS') }
repositories {
mavenCentral()
}
def uiSrcDir = layout.projectDirectory.dir('src/main/ui')
def uiDestBuildDir = layout.buildDirectory.dir('ui')
node {
download = findProperty('downloadNode') as boolean
version = '18.12.1'
nodeProjectDir.set(uiSrcDir)
}
tasks.register('reactTest', NpmTask) {
dependsOn 'npmInstall'
args = ['run', 'test']
}
tasks.register('reactBuild', NpmTask) {
dependsOn 'npmInstall'
inputs.files(uiSrcDir.file('package.json'), uiSrcDir.file('package-lock.json'))
inputs.dir(uiSrcDir.dir('src'))
inputs.dir(uiSrcDir.dir('public'))
outputs.dir(uiDestBuildDir)
args = ['run', 'build']
execOverrides {
environment('BUILD_PATH', uiDestBuildDir.get().dir('static'))
}
}
tasks.named('bootJar') {
dependsOn reactBuild
classpath(uiDestBuildDir)
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
tasks.named('test', Test) {
useJUnitPlatform()
}