forked from liferay/clay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
101 lines (86 loc) · 1.83 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
var inquirer = require('inquirer');
var path = require('path');
var gulp = require('gulp-help')(require('gulp'));
var plugins = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var chalk = require('chalk');
var _ = require('./lib/lodash_utils');
var BOOTSTRAP_VAR_FILE = path.join('src','scss', 'bootstrap', '_variables.scss');
var BOOTSTRAP_VAR_DIR = path.dirname(BOOTSTRAP_VAR_FILE);
var config = {
BOOTSTRAP_VAR_FILE: BOOTSTRAP_VAR_FILE,
BOOTSTRAP_VAR_DIR: BOOTSTRAP_VAR_DIR,
SRC_GLOB: 'src/**/*'
};
var tasks = require('require-dir')('./tasks');
_.invoke(tasks, 'call', tasks, gulp, plugins, _, config);
gulp.task('default', ['build']);
gulp.task('build', function(cb) {
runSequence(
'build:patch-bootstrap',
'build:svg',
'build:metalsmith',
'build:clean-bootstrap-patch',
cb
);
});
gulp.task(
'release:files',
function(cb) {
runSequence(
'build:patch-bootstrap',
'release:clean',
'release:build',
'release:svg',
'release:zip',
'build:clean-bootstrap-patch',
cb
);
}
);
gulp.task(
'release',
function(cb) {
var questions = [
{
default: false,
message: 'Do you want to create a git tag and push to gh-pages?',
name: 'publish',
type: 'confirm'
},
{
default: false,
message: 'Do you want to push to the Maven repo?',
name: 'maven',
type: 'confirm',
when: function(answers) {
return answers.publish;
}
}
];
runSequence(
'release:files',
function() {
inquirer.prompt(
questions,
function(answers) {
if (answers.publish) {
var args = [
'release:git',
'release:publish',
cb
];
if (answers.maven) {
args.splice(2, 0, 'maven-publish');
}
runSequence.apply(null, args);
}
else {
cb();
}
}
);
}
);
}
);