-
Notifications
You must be signed in to change notification settings - Fork 18
/
gulpfile.js
81 lines (60 loc) · 2.08 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
// -------------------------------------------------------------------
// :: GULP CONFIGURATION
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// :: COMMON TASKS
// -------------------------------------------------------------------
//
// - gulp: defaults to 'gulp server' and opens it in the browser
'use strict';
var gulp = require('gulp');
var fileSystem = require('fs');
var clean = require('./gulp/clean'),
copy = require('./gulp/copy'),
copy = require('./gulp/iconfont'),
git = require('./gulp/git'),
semver = require('./gulp/semver'),
server = require('./gulp/server'),
styles = require('./gulp/styles'),
templates = require('./gulp/templates');
// -------------------------------------------------------------------
// :: GULP DEFAULT
// -------------------------------------------------------------------
// Default task = run server
gulp.task('default', ['server']);
gulp.task('build', ['clean-dist'], function(callback) {
var run = require('run-sequence').use(gulp);
run(['icon-font', 'sass-dist', 'copy'], function() {
callback();
});
});
gulp.task('build-docs', ['clean-docs'], function(callback) {
var run = require('run-sequence').use(gulp);
run(['icon-font', 'sass-dist', 'copy'], function() {
callback();
});
});
gulp.task('bump', ['build'], function(callback) {
var run = require('run-sequence').use(gulp);
run(['semver'], 'git', function() {
callback();
});
});
gulp.task('docs', ['build-docs'], function(callback) {
var run = require('run-sequence').use(gulp);
run(['copy-docs', 'replace'], function() {
callback();
});
});
gulp.task('release', ['bump'], function(callback) {
var run = require('run-sequence').use(gulp);
run(['git-tag'], function() {
// Log the new version
var nodePackageFile = JSON.parse(fileSystem.readFileSync('./package.json'));
var version = nodePackageFile.version;
console.log('\n----++++ Version ' + version + ' is ready to be pushed! ++++----\n');
callback();
});
});
// Alias for build task
gulp.task('package', ['build']);