-
Notifications
You must be signed in to change notification settings - Fork 74
/
gulpfile.js
52 lines (44 loc) · 1.4 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
const gulp = require('gulp');
const build = require('./scripts/build');
const buildJS = require('./scripts/buildJS');
const checkElectron = require('./scripts/checkElectron');
const {
buildDir,
jsDir,
cleanDir,
destIrisSDKDir,
destNativeSDKDir,
} = require('./scripts/clean');
const downloadPrebuild = require('./scripts/downloadPrebuild');
const getConfig = require('./scripts/getConfig');
const logger = require('./scripts/logger');
const syncLib = require('./scripts/synclib');
const zipBuild = require('./scripts/zipBuild');
const config = getConfig();
logger.info(`Get Config: \n${JSON.stringify(config, undefined, 4)}`);
const clean = async (cb) => {
await cleanDir(destIrisSDKDir);
await cleanDir(destNativeSDKDir);
await cleanDir(buildDir);
await cleanDir(jsDir);
cb();
};
const totalBuild = gulp.series(clean, syncLib, checkElectron, build, buildJS);
const wrapDownloadPreBuild = async (cb) => {
await downloadPrebuild(cb);
};
const NPM_Install = config.prebuilt
? wrapDownloadPreBuild
: async () => {
logger.warn('config prebuilt is false, skip `NPM_Install`');
};
exports.syncLib = syncLib;
exports.clean = clean;
exports.build = build;
exports.buildJS = buildJS;
exports.zipBuild = zipBuild;
exports.checkElectron = checkElectron;
exports.totalBuild = totalBuild;
exports.NPM_Install = NPM_Install;
exports.downloadPrebuild = downloadPrebuild;
exports.default = totalBuild;