-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.ts
61 lines (56 loc) · 2.27 KB
/
gulpfile.ts
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
import path from 'path';
import { promisify } from 'util';
import del from 'del';
import { glob } from 'glob';
import { parallel, series } from 'gulp';
import { buildElectron } from './apps/electron/electron.gulp';
import {
testElectron,
uiTestElectron,
unitTestElectron,
} from './apps/electron/test/test.gulp';
import { buildScreenshotter } from './apps/screenshotter/screenshotter.gulp';
import { testWeb } from './apps/web/test/test.gulp';
import { buildWeb } from './apps/web/web.gulp';
import { testCodemirror } from './packages/codemirror/test/test.gulp';
import { testCommonPlatform } from './packages/common-platform/test/test.gulp';
import { testCoreDOMPlatform } from './packages/core-dom-platform/test/test.gulp';
import { testRenderer } from './packages/renderer/test/test.gulp';
import { testRhymeGenerator } from './packages/rhyme-generator/test/test.gulp';
export * from './apps/web/web.gulp';
export * from './apps/web/test/test.gulp';
export * from './apps/electron/electron.gulp';
export * from './apps/electron/test/test.gulp';
export * from './apps/mobile/mobile.gulp';
export * from './apps/screenshotter/screenshotter.gulp';
export * from './packages/codemirror/test/test.gulp';
export * from './packages/common-platform/test/test.gulp';
export * from './packages/core-dom-platform/test/test.gulp';
export * from './packages/renderer/test/test.gulp';
export * from './packages/rhyme-generator/test/test.gulp';
export const buildAll = parallel(buildWeb, buildElectron);
export const testCore = series(
testCodemirror,
testCommonPlatform,
testRhymeGenerator,
testRenderer
);
export const testAllWeb = series(testWeb, testCore, testCoreDOMPlatform);
export const testAllElectron = series(testElectron, testCore);
export const unitTests = series(
unitTestElectron,
testCoreDOMPlatform,
testCore
);
export const uiTests = series(uiTestElectron, testWeb, buildScreenshotter);
export const testAll = series(unitTests, uiTests);
export const clean = async () => {
const tsConfigs = await promisify(glob)('!(node_modules)/*/tsconfig.json');
tsConfigs
.map((tsConfig) => path.resolve(path.dirname(tsConfig), 'build'))
.forEach((buildDir) => {
console.log(`Cleaning ${buildDir}`);
del.sync(buildDir);
});
};
export const check = parallel(buildAll, testAll);