-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
237 lines (216 loc) · 7.39 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
// Copyright (C) 2022 reallyread.it, inc.
//
// This file is part of Readup.
//
// Readup is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
//
// Readup is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License version 3 along with Foobar. If not, see <https://www.gnu.org/licenses/>.
const { parallel, series } = require('gulp'),
project = require('./build/project'),
Server = require('./build/targets/Server'),
client = require('./build/targets/client'),
embed = require('./build/targets/embed'),
extension = require('./build/targets/extension'),
nativeClientReader = require('./build/targets/nativeClient/reader'),
nativeClientShareExtension = require('./build/targets/nativeClient/shareExtension'),
metadataParser = require('./build/targets/metadataParser'),
contentParser = require('./build/targets/contentParser');
/**
* app
*/
const server = new Server();
function cleanDevServer() {
return server.clean(project.env.dev);
}
function buildDevServer() {
return server.build(project.env.dev);
}
function cleanStageServer() {
return server.clean(project.env.stage);
}
function buildStageServer() {
return server.build(project.env.stage);
}
function cleanProdServer() {
return server.clean(project.env.prod);
}
function buildProdServer() {
return server.build(project.env.prod);
}
function cleanDevBrowser() {
return client.clean(project.env.dev);
}
function buildDevBrowser() {
return client.build(project.env.dev);
}
function cleanStageBrowser() {
return client.clean(project.env.stage);
}
function buildStageBrowser() {
return client.build(project.env.stage);
}
function cleanProdBrowser() {
return client.clean(project.env.prod);
}
function buildProdBrowser() {
return client.build(project.env.prod);
}
/**
* contentParser
*/
function cleanDevContentParser() {
return contentParser.clean(project.env.dev);
}
function buildDevContentParser() {
return contentParser.build(project.env.dev);
}
/**
* embed
*/
function cleanDevEmbed() {
return embed.clean(project.env.dev);
}
function buildDevEmbed() {
return embed.build(project.env.dev);
}
function cleanProdEmbed() {
return embed.clean(project.env.prod);
}
function buildProdEmbed() {
return embed.build(project.env.prod);
}
/**
* extension
*/
function cleanDevExtension() {
return extension.clean(project.env.dev);
}
function buildDevExtension() {
return extension.build(project.env.dev);
}
function cleanStageExtension() {
return extension.clean(project.env.stage);
}
function buildStageExtension() {
return extension.build(project.env.stage);
}
function cleanProdExtension() {
return extension.clean(project.env.prod);
}
function buildProdExtension() {
return extension.build(project.env.prod);
}
/**
* metadataParser
*/
function cleanDevMetadataParser() {
return metadataParser.clean(project.env.dev);
}
function buildDevMetadataParser() {
return metadataParser.build(project.env.dev);
}
/**
* native client reader
*/
function cleanDevNativeClientReader() {
return nativeClientReader.clean(project.env.dev);
}
function buildDevNativeClientReader() {
return nativeClientReader.build(project.env.dev);
}
function cleanStageNativeClientReader() {
return nativeClientReader.clean(project.env.stage);
}
function buildStageNativeClientReader() {
return nativeClientReader.build(project.env.stage);
}
function cleanProdNativeClientReader() {
return nativeClientReader.clean(project.env.prod);
}
function buildProdNativeClientReader() {
return nativeClientReader.build(project.env.prod);
}
/**
* native client share extension
*/
function cleanDevNativeClientShareExtension() {
return nativeClientShareExtension.clean(project.env.dev);
}
function buildDevNativeClientShareExtension() {
return nativeClientShareExtension.build(project.env.dev);
}
function cleanStageNativeClientShareExtension() {
return nativeClientShareExtension.clean(project.env.stage);
}
function buildStageNativeClientShareExtension() {
return nativeClientShareExtension.build(project.env.stage);
}
function cleanProdNativeClientShareExtension() {
return nativeClientShareExtension.clean(project.env.prod);
}
function buildProdNativeClientShareExtension() {
return nativeClientShareExtension.build(project.env.prod);
}
module.exports = {
'clean:dev:app': parallel(cleanDevServer, cleanDevBrowser),
'build:dev:app': parallel(buildDevServer, buildDevBrowser),
'run:dev:app': series(parallel(buildDevServer, buildDevBrowser), server.run),
'watch:dev:app': parallel(client.watch, server.watch),
'clean:stage:app': parallel(cleanStageServer, cleanStageBrowser),
'build:stage:app': parallel(buildStageServer, buildStageBrowser),
'clean:prod:app': parallel(cleanProdServer, cleanProdBrowser),
'build:prod:app': parallel(buildProdServer, buildProdBrowser),
'clean:dev:server': cleanDevServer,
'build:dev:server': buildDevServer,
'run:dev:server': series(buildDevServer, server.run),
'watch:dev:server': server.watch,
'clean:stage:server': cleanStageServer,
'build:stage:server': buildStageServer,
'clean:prod:server': cleanProdServer,
'build:prod:server': buildProdServer,
'clean:dev:browser': cleanDevBrowser,
'build:dev:browser': buildDevBrowser,
'watch:dev:browser': client.watch,
'clean:stage:browser': cleanStageBrowser,
'build:stage:browser': buildStageBrowser,
'clean:prod:browser': cleanProdBrowser,
'build:prod:browser': buildProdBrowser,
'clean:dev:content-parser': cleanDevContentParser,
'build:dev:content-parser': buildDevContentParser,
'watch:dev:content-parser': contentParser.watch,
'clean:dev:embed': cleanDevEmbed,
'build:dev:embed': buildDevEmbed,
'watch:dev:embed': embed.watch,
'clean:prod:embed': cleanProdEmbed,
'build:prod:embed': buildProdEmbed,
'clean:dev:extension': cleanDevExtension,
'build:dev:extension': buildDevExtension,
'watch:dev:extension': extension.watch,
'clean:stage:extension': cleanStageExtension,
'build:stage:extension': buildStageExtension,
'clean:prod:extension': cleanProdExtension,
'build:prod:extension': buildProdExtension,
'clean:dev:metadata-parser': cleanDevMetadataParser,
'build:dev:metadata-parser': buildDevMetadataParser,
'watch:dev:metadata-parser': metadataParser.watch,
'clean:dev:native-client-reader': cleanDevNativeClientReader,
'build:dev:native-client-reader': buildDevNativeClientReader,
'watch:dev:native-client-reader': nativeClientReader.watch,
'clean:stage:native-client-reader': cleanStageNativeClientReader,
'build:stage:native-client-reader': buildStageNativeClientReader,
'clean:prod:native-client-reader': cleanProdNativeClientReader,
'build:prod:native-client-reader': buildProdNativeClientReader,
'clean:dev:native-client-share-extension': cleanDevNativeClientShareExtension,
'build:dev:native-client-share-extension': buildDevNativeClientShareExtension,
'watch:dev:native-client-share-extension': nativeClientShareExtension.watch,
'clean:stage:native-client-share-extension':
cleanStageNativeClientShareExtension,
'build:stage:native-client-share-extension':
buildStageNativeClientShareExtension,
'clean:prod:native-client-share-extension':
cleanProdNativeClientShareExtension,
'build:prod:native-client-share-extension':
buildProdNativeClientShareExtension,
};