forked from zhcet-amu/zhcet-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-js.gradle
50 lines (43 loc) · 1.61 KB
/
build-js.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
node {
version = '8.12.0'
download = true
}
task yarn_build(type: YarnTask, dependsOn: 'yarn_install') {
inputs.dir "${ project.projectDir }/src/main/resources/src"
outputs.dir "${ project.projectDir }/src/main/resources/static/js/build"
args = ['build']
}
task yarn_build_dev(type: YarnTask, dependsOn: 'yarn_install') {
inputs.dir "${ project.projectDir }/src/main/resources/src"
outputs.dir "${ project.projectDir }/src/main/resources/static/js/build"
args = ['build-dev']
}
task yarn_watch(type: YarnTask, dependsOn: 'yarn_install') {
inputs.dir "${ project.projectDir }/src/main/resources/src"
outputs.dir "${ project.projectDir }/src/main/resources/static/js/build"
args = ['watch']
}
task copyResources(type: Copy) {
def sourceFolder = "${ project.projectDir }/src/main/resources/static/js/build"
def destinationFolder = "${ project.buildDir }/resources/main/static/js/build"
inputs.dir sourceFolder
outputs.dir destinationFolder
from sourceFolder
into destinationFolder
}
task copyResourcesDev(type: Copy) {
def sourceFolder = "${ project.projectDir }/src/main/resources/static/js/build"
def destinationFolder = "out/production/resources/static/js/build"
inputs.dir sourceFolder
outputs.dir destinationFolder
from sourceFolder
into destinationFolder
}
task cleanResources(type: Delete) {
delete "${ project.projectDir }/src/main/resources/static/js/build"
}
processResources.dependsOn yarn_build_dev
copyResources.dependsOn yarn_build
copyResourcesDev.dependsOn yarn_build_dev
bootJar.dependsOn copyResources
clean.dependsOn cleanResources