This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
calcifer/web/semantic/tasks/build.js

51 lines
1,014 B
JavaScript
Raw Normal View History

2015-03-29 19:33:23 +02:00
/*******************************
Build Task
*******************************/
var
2016-06-10 00:34:34 +02:00
// dependencies
gulp = require('gulp-help')(require('gulp')),
runSequence = require('run-sequence'),
2015-03-29 19:33:23 +02:00
// config
config = require('./config/user'),
install = require('./config/project/install'),
2016-06-10 00:34:34 +02:00
// task sequence
tasks = []
2015-03-29 19:33:23 +02:00
;
2016-06-10 00:34:34 +02:00
// sub-tasks
if(config.rtl) {
require('./collections/rtl')(gulp);
}
require('./collections/build')(gulp);
2015-03-29 19:33:23 +02:00
2016-06-10 00:34:34 +02:00
module.exports = function(callback) {
2015-03-29 19:33:23 +02:00
console.info('Building Semantic');
if( !install.isSetup() ) {
2016-06-10 00:34:34 +02:00
console.error('Cannot find semantic.json. Run "gulp install" to set-up Semantic');
2015-03-29 19:33:23 +02:00
return;
}
2016-06-10 00:34:34 +02:00
// check for right-to-left (RTL) language
2015-03-29 19:33:23 +02:00
if(config.rtl === true || config.rtl === 'Yes') {
gulp.start('build-rtl');
return;
}
2016-06-10 00:34:34 +02:00
if(config.rtl == 'both') {
tasks.push('build-rtl');
}
2015-03-29 19:33:23 +02:00
2016-06-10 00:34:34 +02:00
tasks.push('build-javascript');
tasks.push('build-css');
tasks.push('build-assets');
2015-03-29 19:33:23 +02:00
2016-06-10 00:34:34 +02:00
runSequence(tasks, callback);
};