forked from marklogic-community/grove-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.build.gradle
61 lines (51 loc) · 1.69 KB
/
app.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
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.4.RELEASE"
classpath "com.moowork.gradle:gradle-node-plugin:1.3.1"
}
}
apply plugin: "java"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "com.moowork.node"
ext {
taskGroup = "Spring Boot UI"
}
bootJar {
baseName = springBootJarName
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "com.marklogic:marklogic-client-api:4.2.0"
}
task installDependencies(type: NpmTask, group: taskGroup) {
description = "Install UI dependencies before building the UI files"
args = ["install"]
execOverrides { it.workingDir = groveUiPath }
}
task buildUi(type: NpmTask, dependsOn: installDependencies, group: taskGroup) {
description = "Builds the UI files so that they can be copied to the Spring Boot application"
args = ["run", "build"]
execOverrides { it.workingDir = groveUiPath }
}
task deleteSpringBootUiFiles(type: Delete, group: taskGroup) {
description = "Delete the UI files that may have already been copied over to the Spring Boot UI directory"
delete springBootUiPath
}
task copyUiFiles(type: Copy, dependsOn: deleteSpringBootUiFiles, group: taskGroup) {
description = "Copies the UI files to a directory where Spring Boot will include them in the executable bootJar file"
from groveUiPath + "/build"
into springBootUiPath
}
// Before the Spring Boot jar is built, build the UI files and copy them over
build.dependsOn buildUi
build.dependsOn copyUiFiles
copyUiFiles.mustRunAfter buildUi