-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
65 lines (51 loc) · 1.68 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
plugins {
id "com.moowork.node" version "1.2.0"
}
apply plugin: 'base'
node {
// Version of node to use.
version = rootProject.nodejsVersion
// Base URL for fetching node distributions (change if you have a mirror).
distBaseUrl = 'https://nodejs.org/dist'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file("${project.projectDir}/tools/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${project.projectDir}/tools/npm")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}/frontend")
}
task cleanBundle(type: Delete) {
delete 'bin', 'build', 'frontend/build', 'frontend/node_modules', 'tools/nodejs'
}
task startMockedBackend(type: NpmTask) {
group = 'testing'
description = "UI Mocked Backend"
args = ['run', 'start:mocked-backend']
}
task javaScriptCoverage(type: NpmTask) {
group = 'testing'
description = "UI JavaScript Test Coverage"
args = ['run', 'coverage']
}
task runTests(type: NpmTask) {
group = 'testing'
description = "UI JavaScript Test Coverage"
args = ['run', 'test']
}
task bundle(type: NpmTask) {
inputs.dir('frontend/src')
inputs.dir('frontend/public')
inputs.files('frontend/.env*')
inputs.file('frontend/eslintrc.json')
inputs.file('frontend/package.json')
outputs.dir('frontend/build')
dependsOn npmInstall
args = ['run', 'build']
}
clean.dependsOn cleanBundle
build.dependsOn bundle
javaScriptCoverage.dependsOn bundle
runTests.dependsOn bundle