build.js
1016 Bytes
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
/*******************************
Build Task
*******************************/
var
// dependencies
gulp = require('gulp-help')(require('gulp')),
runSequence = require('run-sequence'),
// config
config = require('./config/user'),
install = require('./config/project/install'),
// task sequence
tasks = []
;
// sub-tasks
if(config.rtl) {
require('./collections/rtl')(gulp);
}
require('./collections/build')(gulp);
module.exports = function(callback) {
console.info('Building Semantic');
if( !install.isSetup() ) {
console.error('Cannot find semantic.json. Run "gulp install" to set-up Semantic');
return 1;
}
// check for right-to-left (RTL) language
if(config.rtl === true || config.rtl === 'Yes') {
gulp.start('build-rtl');
return;
}
if(config.rtl == 'both') {
tasks.push('build-rtl');
}
tasks.push('build-javascript');
tasks.push('build-css');
tasks.push('build-assets');
runSequence(tasks, callback);
};