diff --git a/tasks/README.md b/tasks/README.md index 323475cb5..c602e2223 100644 --- a/tasks/README.md +++ b/tasks/README.md @@ -10,6 +10,8 @@ These tasks can be imported into your own gulpfile allowing you to avoid using Semantic's build tools ```javascript -var watch = require('path/to/semantic/tasks/watch'); -gulp.task('watch ui', 'Watch Semantic UI', watch); +var + watch = require('path/to/semantic/tasks/watch') +; +gulp.task('watch ui', watch); ``` diff --git a/tasks/build.js b/tasks/build.js index 43222dc73..eee4b9fec 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -8,9 +8,14 @@ var // config config = require('./config/user'), install = require('./config/project/install') - ; +// add sub-tasks +if(config.rtl) { + require('./collections/rtl')(gulp); +} +require('./collections/build')(gulp); + module.exports = function(callback) { console.info('Building Semantic'); diff --git a/tasks/collections/build.js b/tasks/collections/build.js new file mode 100644 index 000000000..f7ea28767 --- /dev/null +++ b/tasks/collections/build.js @@ -0,0 +1,19 @@ +/******************************* + Define Sub-Tasks +*******************************/ + +module.exports = function(gulp) { + + var + // build sub-tasks + buildJS = require('./../build/javascript'), + buildCSS = require('./../build/css'), + buildAssets = require('./../build/assets') + ; + + // in case these tasks are undefined during import, less make sure these are available in scope + gulp.task('build-javascript', 'Builds all javascript from source', buildJS); + gulp.task('build-css', 'Builds all css from source', buildCSS); + gulp.task('build-assets', 'Copies all assets from source', buildAssets); + +}; diff --git a/tasks/collections/rtl.js b/tasks/collections/rtl.js new file mode 100644 index 000000000..4c8e70a42 --- /dev/null +++ b/tasks/collections/rtl.js @@ -0,0 +1,16 @@ +/******************************* + Define Sub-Tasks +*******************************/ + +module.exports = function(gulp) { + + var + // rtl + buildRTL = require('./../rtl/build'), + watchRTL = require('./../rtl/watch') + ; + + gulp.task('watch-rtl', 'Build all files as RTL', watchRTL); + gulp.task('build-rtl', 'Watch files as RTL ', buildRTL); + +}; diff --git a/tasks/watch.js b/tasks/watch.js index f870aa8cc..be743c497 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -44,7 +44,10 @@ var ; -// add tasks that shouldn't be exposed to end-user +// add tasks referenced using gulp.run (sub-tasks) +if(config.rtl) { + require('./collections/rtl')(gulp); +} require('./collections/internal')(gulp);