This repository has been archived by the owner on Dec 21, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
gulpfile.js
179 lines (172 loc) · 8.84 KB
/
gulpfile.js
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
var gulp = require('gulp');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var eventStream = require('event-stream');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('build', function () {
var s1 = gulp.src(['app/components/**/module.js',//First include files that register shared modules
'app/**/module.js',//Include files that register modules for various tabs
'app/app.js',
'app/**/*.js',
'!app/bundle.js',//Exclude generated bundle.js
'!app/**/*test.js',//Exclude test files
'!app/**/*.md', //Exclude .md files
'!app/bower_components/**/*.js',
'!app/components/graphobjects/**/*.js',
'!app/main.browser.js',//Exclude files loaded by webpack
'!app/app.module.js',//Exclude files loaded by webpack
'!app/upgradeadapter.js',
'!app/polyfills.browser.js',//Exclude files loaded by webpack
'!app/vendor.browser.js',//Exclude files loaded by webpack
'!app/polyfills.bundle.js',//Exclude bundle generated by webpack
'!app/vendor.bundle.js',//Exclude bundle generated by webpack
'!app/main.bundle.js',//Exclude bundle generated by webpack
'!app/components/models/*model.js',
'!app/components/models/basecollection.js',
'!app/components/models/collection.js',
'!app/components/utils/*service.js',
'!app/components/directives/directives.module.js',
'!app/components/directives/errormessagedirective.js',
'!app/components/pipes/*.js',
'!app/dashboard/dashboardctrl.js',
'!app/network_policies/networkpolicies.module.js',
'!app/network_policies/networkpoliciestabsctrl.js',
'!app/network_policies/isolationpolicylistctrl.js',
'!app/network_policies/bandwidthpolicylistctrl.js',
'!app/network_policies/isolationpolicycreatectrl.js',
'!app/network_policies/isolationpolicydetailsctrl.js',
'!app/network_policies/bandwidthpolicycreatectrl.js',
'!app/network_policies/bandwidthpolicydetailsctrl.js',
'!app/applicationgroups/applicationgroups.module.js',
'!app/applicationgroups/applicationgroupcreatectrl.js',
'!app/applicationgroups/applicationgroupdetailsctrl.js',
'!app/applicationgroups/isolationpolicydirective.js',
'!app/applicationgroups/bandwidthpolicydirective.js',
'!app/settings/settings.module.js',
'!app/settings/networksettingctrl.js',
'!app/components/directives/tabledirective.js',
'!app/components/directives/accordiondirective.js',
'!app/networks/networklistctrl.js',
'!app/networks/network.module.js',
'!app/applicationgroups/applicationgrouplistctrl.js',
'!app/networks/networkstatsctrl.js',
'!app/service_lbs/servicelb.module.js',
'!app/service_lbs/servicelblistctrl.js',
'!app/service_lbs/servicelbstatsctrl.js',
'!app/organizations/organization.module.js',
'!app/organizations/organizationlistctrl.js',
'!app/networks/networkdetailsctrl.js',
'!app/networks/networkinfoctrl.js',
'!app/components/directives/collapsibledirective.js',
'!app/components/directives/namevaluedirective.js',
'!app/networks/networkcreatectrl.js',
'!app/service_lbs/servicelbportsdirective.js',
'!app/service_lbs/servicelbcreatectrl.js',
'!app/service_lbs/servicelbdetailsctrl.js',
'!app/service_lbs/servicelbinfoctrl.js',
'!app/settings/clustersettingctrl.js',
'!app/login/loginctrl.js',
'!app/organizations/organizationcreatectrl.js',
'!app/organizations/organizationdetailsctrl.js'
])//Exclude vendor libraries
.pipe(sourcemaps.init());
//ES6 code
var s2 = gulp.src(['app/components/graphobjects/**/module.js',
'app/components/graphobjects/**/*.js',
'!app/components/graphobjects/**/*test.js',
'!app/components/graphobjects/**/*.md'
])//Exclude vendor libraries
.pipe(sourcemaps.init())
.pipe(babel());
//merge the two streams
eventStream.merge(s1, s2)
.pipe(concat('app/bundle.js'))
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('.'))
});
gulp.task('dev-build', function () {
var s1 = gulp.src(['app/components/**/module.js',//First include files that register shared modules
'app/**/module.js',//Include files that register modules for various tabs
'app/app.js',
'app/**/*.js',
'!app/bundle.js',//Exclude generated bundle.js
'!app/**/*test.js',//Exclude test files
'!app/**/*.md', //Exclude .md files
'!app/bower_components/**/*.js',
'!app/components/graphobjects/**/*.js',
'!app/main.browser.js',//Exclude files loaded by webpack
'!app/app.module.js',//Exclude files loaded by webpack
'!app/upgradeadapter.js',
'!app/polyfills.browser.js',//Exclude files loaded by webpack
'!app/vendor.browser.js',//Exclude files loaded by webpack
'!app/polyfills.bundle.js',//Exclude bundle generated by webpack
'!app/vendor.bundle.js',//Exclude bundle generated by webpack
'!app/main.bundle.js',//Exclude bundle generated by webpack
'!app/components/models/*model.js',
'!app/components/models/basecollection.js',
'!app/components/models/collection.js',
'!app/components/utils/*service.js',
'!app/components/directives/directives.module.js',
'!app/components/directives/errormessagedirective.js',
'!app/components/pipes/*.js',
'!app/dashboard/dashboardctrl.js',
'!app/network_policies/networkpolicies.module.js',
'!app/network_policies/networkpoliciestabsctrl.js',
'!app/network_policies/isolationpolicylistctrl.js',
'!app/network_policies/bandwidthpolicylistctrl.js',
'!app/network_policies/isolationpolicycreatectrl.js',
'!app/network_policies/isolationpolicydetailsctrl.js',
'!app/network_policies/bandwidthpolicycreatectrl.js',
'!app/network_policies/bandwidthpolicydetailsctrl.js',
'!app/applicationgroups/applicationgroups.module.js',
'!app/applicationgroups/applicationgroupcreatectrl.js',
'!app/applicationgroups/applicationgroupdetailsctrl.js',
'!app/applicationgroups/isolationpolicydirective.js',
'!app/applicationgroups/bandwidthpolicydirective.js',
'!app/settings/settings.module.js',
'!app/settings/networksettingctrl.js',
'!app/components/directives/tabledirective.js',
'!app/components/directives/accordiondirective.js',
'!app/networks/networklistctrl.js',
'!app/networks/network.module.js',
'!app/applicationgroups/applicationgrouplistctrl.js',
'!app/networks/networkstatsctrl.js',
'!app/service_lbs/servicelb.module.js',
'!app/service_lbs/servicelblistctrl.js',
'!app/service_lbs/servicelbstatsctrl.js',
'!app/organizations/organization.module.js',
'!app/organizations/organizationlistctrl.js',
'!app/networks/networkdetailsctrl.js',
'!app/networks/networkinfoctrl.js',
'!app/components/directives/collapsibledirective.js',
'!app/components/directives/namevaluedirective.js',
'!app/networks/networkcreatectrl.js',
'!app/service_lbs/servicelbportsdirective.js',
'!app/service_lbs/servicelbcreatectrl.js',
'!app/service_lbs/servicelbdetailsctrl.js',
'!app/service_lbs/servicelbinfoctrl.js',
'!app/settings/clustersettingctrl.js',
'!app/login/loginctrl.js',
'!app/organizations/organizationcreatectrl.js',
'!app/organizations/organizationdetailsctrl.js'
])//Exclude vendor libraries
.pipe(sourcemaps.init());
//ES6 code
var s2 = gulp.src(['app/components/graphobjects/**/module.js',
'app/components/graphobjects/**/*.js',
'!app/components/graphobjects/**/*test.js',
'!app/components/graphobjects/**/*.md'
])//Exclude vendor libraries
.pipe(sourcemaps.init())
.pipe(babel());
//merge the two streams
eventStream.merge(s1, s2)
.pipe(concat('app/bundle.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('.'));
});
gulp.task('watch', ['build'], function () {
gulp.watch('app/**/*.js', ['build'])
});