-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
43 lines (38 loc) · 1.01 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id "base"
id "com.github.node-gradle.node" version "2.2.3"
}
node {
version = '12.16.2' // Version of node to use.
npmVersion = '6.14.4' // Version of npm to use.
distBaseUrl = 'https://nodejs.org/dist'
download = true
// Set the work directory for unpacking node
workDir = file("${project.projectDir}/node/")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}")
npmInstallCommand = 'ci'
}
task cleanJsBuildFiles() {
doLast {
['dist'].each { dir ->
delete "${project.projectDir}/" + dir
}
}
}
task cleanAllJsDependencies(dependsOn: ['cleanJsBuildFiles']) {
doLast {
['node_modules', 'node'].each { dir ->
delete "${project.projectDir}/" + dir
}
}
}
npm_test.dependsOn 'npmInstall'
npm_run_build.dependsOn 'npmInstall'
clean.dependsOn cleanJsBuildFiles