-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (37 loc) · 866 Bytes
/
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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.moowork.gradle:gradle-node-plugin:0.11"
}
}
apply plugin: "com.moowork.node"
node {
version = '0.12.7'
npmVersion = '2.7.5'
workDir = file("${projectDir}/lib/nodejs")
download = true
}
task packageInstall(type: NpmTask) {
args = ["install"]
workingDir = "."
}
task startServer(type: NodeTask) {
workingDir = "."
script = file('index.js')
}
task mocha(type: NpmTask){
args = ["test"]
workingDir = "."
}
task runTest(dependsOn: ['packageInstall', 'mocha'])
mocha.mustRunAfter packageInstall
task build(dependsOn: ['packageInstall'])
task runApp(dependsOn: ['build', 'startServer'])
startServer.mustRunAfter build
task clean(type: Delete) {
delete "lib", "node_modules"
}