-
-
Notifications
You must be signed in to change notification settings - Fork 346
/
gulpfile.js
58 lines (46 loc) · 1.43 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
require('@babel/register')(require('./babel-register.config'))
const gulp = require('gulp')
const childProcess = require('child_process')
const { trim } = require('lodash')
global.ROOT = __dirname
const { log } = require('./build/utils')
const { build, installPlugins, cleanFiles, packWinRelease, deployNightlies } = require('./build')
const packageMeta = require('./package.json')
let poiVersion = null
gulp.task('getVersion', (done) => {
const package_version = packageMeta.version
poiVersion = package_version
childProcess.exec('git rev-parse HEAD', (err, stdout) => {
if (!err) {
global.latestCommit = trim(stdout)
} else {
console.error(err)
}
log(`*** Start building poi ${poiVersion} at ${global.latestCommit} ***`)
done()
})
})
gulp.task(
'build',
gulp.series('getVersion', () => build(poiVersion)),
)
gulp.task(
'build_plugins',
gulp.series('getVersion', () => installPlugins(poiVersion)),
)
gulp.task(
'pack_win_release',
gulp.series('getVersion', () => packWinRelease(poiVersion)),
)
gulp.task('deploy_nightlies', () => deployNightlies())
gulp.task('clean', () => cleanFiles())
gulp.task('default', (done) => {
log`
Usage:
gulp deploy - Make this repo ready to use
gulp build - Build release complete packages under ./dist/
gulp build_plugins - Pack up latest plugin tarballs under ./dist/
extra arguments will be passed to npm if it is used
`
done()
})