forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (71 loc) · 2.17 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
apply plugin: 'distribution'
apply plugin: 'com.moowork.node'
node {
// Version of node to use.
version = '10.6.0'
// Version of Yarn to use.
yarnVersion = '1.13.0'
// 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.buildDir}/nodejs")
// Set the work directory for NPM
yarnWorkDir = file("${project.buildDir}/yarn")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}")
}
def yarnMainProject = 'wherehows-web'
task execYarn(type: YarnTask) {
if (project.hasProperty('yarnArgs')) {
args = yarnArgs.tokenize()
}
}
task execEmber(type: NodeTask, dependsOn: execYarn) {
script = file('node_modules/.bin/ember')
if (project.hasProperty('emberArgs')) {
args = emberArgs.tokenize()
}
}
task emberLintJs(type: YarnTask, dependsOn: execYarn) {
args = ['run', 'lint:js']
}
task emberLintHbs(type: YarnTask, dependsOn: emberLintJs) {
args = ['run', 'lint:hbs']
}
task emberServe(type: YarnTask, dependsOn: emberLintHbs) {
args = ['workspace', yarnMainProject, 'run', 'start', '--proxy', 'http://localhost:9001', '--secure-proxy=false']
}
task emberWorkspaceTest(type: YarnTask, dependsOn: emberLintHbs) {
args = ['run', 'test']
}
task emberBuild(type: YarnTask, dependsOn: emberWorkspaceTest) {
args = ['workspace', yarnMainProject, 'run', 'build', '--environment', 'production']
}
task emberTest(type: YarnTask, dependsOn: emberLintHbs) {
args = ['workspace', yarnMainProject, 'run', 'test']
}
task emberCoverage(type: YarnTask, dependsOn: emberLintHbs) {
args = ['workspace', yarnMainProject, 'run', 'coverage']
}
clean {
delete 'node_modules'
delete 'dist'
delete 'tmp'
delete 'just'
}
configurations {
assets
}
distZip {
dependsOn emberBuild
baseName 'datahub-web'
from 'packages/data-portal/dist'
}
if (!gradle.startParameter.taskNames.any { it in ["idea"] }) {
artifacts {
assets distZip
}
}