diff --git a/resources/gulp/components/account.js b/resources/gulp/components/account.js index b2f9e00431..2eb0d99d4f 100644 --- a/resources/gulp/components/account.js +++ b/resources/gulp/components/account.js @@ -12,14 +12,22 @@ gulp.task('build-account-css', function(){ ], 'account', 'account/css/'); }); -gulp.task('watch-account', function() { - gulp.watch(config.paths.src + 'account/**/*.scss', ['build-account-css']); -}); - -gulp.task('build-account', ['copy-account-images', 'build-account-css'], function(){ +gulp.task('build-account-js', function(){ var accountGroup = [ config.paths.vendors + 'requirejs/require.js', config.paths.src + 'account/js/account.js' ]; return utils.buildJsGroup(accountGroup, 'account', 'account/js'); +}); + +gulp.task('watch-account-js', function() { + return gulp.watch(config.paths.src + 'account/**/*.js', ['build-account-js']); +}); + +gulp.task('watch-account-css', function() { + gulp.watch(config.paths.src + 'account/**/*.scss', ['build-account-css']); +}); + +gulp.task('build-account', ['copy-account-images', 'build-account-css'], function(){ + return gulp.start('build-account-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/admin.js b/resources/gulp/components/admin.js index bb3627cc79..4b0dea0efa 100644 --- a/resources/gulp/components/admin.js +++ b/resources/gulp/components/admin.js @@ -12,11 +12,7 @@ gulp.task('build-admin-css', function(){ ], 'admin', 'admin/css/'); }); -gulp.task('watch-admin', function() { - gulp.watch(config.paths.src + 'admin/**/*.scss', ['build-admin-css']); -}); - -gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){ +gulp.task('build-admin-js', function(){ var adminGroup = [ config.paths.vendors + 'underscore-amd/underscore.js', config.paths.vendors + 'jquery-treeview/jquery.treeview.js', @@ -27,4 +23,16 @@ gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){ config.paths.dist + 'scripts/apps/admin/main/main.js' ]; utils.buildJsGroup(adminGroup, 'admin', 'admin/js'); +}); + +gulp.task('watch-admin-js', function() { + return gulp.watch(config.paths.src + 'admin/**/*.js', ['build-admin-js']); +}); + +gulp.task('watch-admin-css', function() { + gulp.watch(config.paths.src + 'admin/**/*.scss', ['build-admin-css']); +}); + +gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){ + return gulp.start('build-admin-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/authentication.js b/resources/gulp/components/authentication.js index c79eec7c83..79c32f582d 100644 --- a/resources/gulp/components/authentication.js +++ b/resources/gulp/components/authentication.js @@ -12,14 +12,22 @@ gulp.task('build-authentication-css', function(){ ], 'authentication', 'authentication/css/'); }); -gulp.task('watch-authentication', function() { - gulp.watch(config.paths.src + 'authentication/**/*.scss', ['build-authentication-css']); -}); - -gulp.task('build-authentication', ['copy-authentication-images', 'build-authentication-css'], function(){ +gulp.task('build-authentication-js', function(){ var authenticationGroup = [ config.paths.vendors + 'requirejs/require.js', config.paths.dist + 'scripts/apps/login/home/config.js' ]; return utils.buildJsGroup(authenticationGroup, 'authentication', 'authentication/js'); +}); + +gulp.task('watch-authentication-js', function() { + return gulp.watch(config.paths.src + 'authentication/**/*.js', ['build-authentication-js']); +}); + +gulp.task('watch-authentication-css', function() { + gulp.watch(config.paths.src + 'authentication/**/*.scss', ['build-authentication-css']); +}); + +gulp.task('build-authentication', ['copy-authentication-images', 'build-authentication-css'], function(){ + return gulp.start('build-authentication-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/common.js b/resources/gulp/components/common.js index b56e9dd1b5..b822d817ce 100644 --- a/resources/gulp/components/common.js +++ b/resources/gulp/components/common.js @@ -23,11 +23,7 @@ gulp.task('build-common-css', ['build-common-font-css'],function(){ ], 'common', 'common/css/') }); -gulp.task('watch-common', function() { - gulp.watch(config.paths.src + 'common/**/*.scss', ['build-common-css']); -}); - -gulp.task('build-common', ['copy-common-images', 'build-common-css'], function(){ +gulp.task('build-common-js', function(){ var commonGroup = [ // config.paths.dist + 'assets/bootstrap/js/bootstrap.js', // should append no conflict config.paths.src + 'vendors/jquery-mousewheel/js/jquery.mousewheel.js', @@ -47,4 +43,16 @@ gulp.task('build-common', ['copy-common-images', 'build-common-css'], function() config.paths.dist + 'include/jslibs/flowplayer/flowplayer-3.2.13.min.js' // @TODO: should be moved away (embed-bundle) ]; return utils.buildJsGroup(commonGroup, 'common', 'common/js'); +}); + +gulp.task('watch-common-js', function() { + return gulp.watch(config.paths.src + 'common/**/*.js', ['build-common-js']); +}); + +gulp.task('watch-common-css', function() { + gulp.watch(config.paths.src + 'common/**/*.scss', ['build-common-css']); +}); + +gulp.task('build-common', ['copy-common-images', 'build-common-css'], function(){ + return gulp.start('build-common-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/lightbox.js b/resources/gulp/components/lightbox.js index bb5cdc826a..8bb70699f1 100644 --- a/resources/gulp/components/lightbox.js +++ b/resources/gulp/components/lightbox.js @@ -32,11 +32,7 @@ gulp.task('build-lightbox-css', ['build-lightbox-mobile-css', 'build-lightbox-ie ], 'lightbox', 'lightbox/css/') }); -gulp.task('watch-lightbox', function() { - gulp.watch(config.paths.src + 'lightbox/**/*.scss', ['build-lightbox-css']); -}); - -gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css', 'build-lightbox-mobile-js'], function(){ +gulp.task('build-lightbox-js', ['build-lightbox-mobile-js'], function(){ var lightboxGroup = [ config.paths.src + 'lightbox/js/jquery.lightbox.js' ]; @@ -46,4 +42,16 @@ gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css', 'buil ]; utils.buildJsGroup(lightboxIE6Group, 'lightboxIe6', 'lightbox/js'); return utils.buildJsGroup(lightboxGroup, 'lightbox', 'lightbox/js'); +}); + +gulp.task('watch-lightbox-js', function() { + return gulp.watch(config.paths.src + 'lightbox/**/*.js', ['build-lightbox-js']); +}); + +gulp.task('watch-lightbox-css', function() { + gulp.watch(config.paths.src + 'lightbox/**/*.scss', ['build-lightbox-css']); +}); + +gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css'], function(){ + return gulp.start('build-lightbox-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/oauth.js b/resources/gulp/components/oauth.js index e0b4a2cb38..e819a259f7 100644 --- a/resources/gulp/components/oauth.js +++ b/resources/gulp/components/oauth.js @@ -2,7 +2,7 @@ var gulp = require('gulp'); var config = require('../config.js'); var utils = require('../utils.js'); -gulp.task('watch-oauth', function() { +gulp.task('watch-oauth-css', function() { gulp.watch(config.paths.src + 'oauth/**/*.scss', ['build-oauth']); }); diff --git a/resources/gulp/components/prod.js b/resources/gulp/components/prod.js index 6e62a562a9..1b34aaaec3 100644 --- a/resources/gulp/components/prod.js +++ b/resources/gulp/components/prod.js @@ -59,12 +59,7 @@ gulp.task('build-prod-css', ['build-prod-skin-black', 'build-prod-skin-grey'], f config.paths.src + 'prod/styles/main.scss' ], 'prod', 'prod/css/'); }); - -gulp.task('watch-prod', function() { - return gulp.watch(config.paths.src + 'prod/**/*.scss', ['build-prod-css']); -}); - -gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){ +gulp.task('build-prod-js', function(){ var prodGroup = [ config.paths.vendors + 'underscore-amd/underscore.js', config.paths.src + 'vendors/colorpicker/js/colorpicker.js', @@ -97,4 +92,15 @@ gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){ config.paths.vendors + 'fancytree/dist/jquery.fancytree-all.min.js' ]; return utils.buildJsGroup(prodGroup, 'prod', 'prod/js'); +}); +gulp.task('watch-prod-js', function() { + return gulp.watch(config.paths.src + 'prod/**/*.js', ['build-prod-js']); +}); + +gulp.task('watch-prod-css', function() { + return gulp.watch(config.paths.src + 'prod/**/*.scss', ['build-prod-css']); +}); + +gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){ + return gulp.start('build-prod-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/report.js b/resources/gulp/components/report.js index 9731899e89..f0e41eddad 100644 --- a/resources/gulp/components/report.js +++ b/resources/gulp/components/report.js @@ -19,11 +19,7 @@ gulp.task('build-report-css', ['build-report-print-css'], function(){ ], 'report', 'report/css/'); }); -gulp.task('watch-report', function() { - gulp.watch(config.paths.src + 'report/**/*.scss', ['build-report-css']); -}); - -gulp.task('build-report', ['copy-report-images', 'build-report-css'], function(){ +gulp.task('build-report-js', function(){ var reportGroup = [ config.paths.src + 'report/js/jquery.print.js', config.paths.src + 'report/js/jquery.cluetip.js', @@ -32,4 +28,16 @@ gulp.task('build-report', ['copy-report-images', 'build-report-css'], function() config.paths.src + 'report/js/report.js' ]; return utils.buildJsGroup(reportGroup, 'report', 'report/js'); +}); + +gulp.task('watch-report-js', function() { + return gulp.watch(config.paths.src + 'report/**/*.js', ['build-report-js']); +}); + +gulp.task('watch-report-css', function() { + gulp.watch(config.paths.src + 'report/**/*.scss', ['build-report-css']); +}); + +gulp.task('build-report', ['copy-report-images', 'build-report-css'], function(){ + return gulp.start('build-report-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/setup.js b/resources/gulp/components/setup.js index 248299dbad..a393d02bbe 100644 --- a/resources/gulp/components/setup.js +++ b/resources/gulp/components/setup.js @@ -12,11 +12,7 @@ gulp.task('build-setup-css', function(){ ], 'setup', 'setup/css/'); }); -gulp.task('watch-setup', function() { - gulp.watch(config.paths.src + 'setup/**/*.scss', ['build-setup-css']); -}); - -gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){ +gulp.task('build-setup-js', function(){ var setupGroup = [ config.paths.vendors + 'jquery.cookie/jquery.cookie.js', config.paths.src + 'vendors/jquery-validation/js/jquery.validate.js', @@ -24,4 +20,16 @@ gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){ config.paths.src + 'setup/js/path_files_tests.jquery.js' ]; return utils.buildJsGroup(setupGroup, 'setup', 'setup/js'); +}); + +gulp.task('watch-setup-js', function() { + return gulp.watch(config.paths.src + 'setup/**/*.js', ['build-setup-js']); +}); + +gulp.task('watch-setup-css', function() { + gulp.watch(config.paths.src + 'setup/**/*.scss', ['build-setup-css']); +}); + +gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){ + return gulp.start('build-setup-js'); }); \ No newline at end of file diff --git a/resources/gulp/components/thesaurus.js b/resources/gulp/components/thesaurus.js index 9b1331b90b..73d1c02350 100644 --- a/resources/gulp/components/thesaurus.js +++ b/resources/gulp/components/thesaurus.js @@ -12,11 +12,7 @@ gulp.task('build-thesaurus-css', function(){ ], 'thesaurus', 'thesaurus/css/'); }); -gulp.task('watch-thesaurus', function() { - gulp.watch(config.paths.src + 'thesaurus/**/*.scss', ['build-thesaurus-css']); -}); - -gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], function(){ +gulp.task('build-thesaurus-js', function(){ var thesaurusGroup = [ config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js', config.paths.src + 'thesaurus/js/win.js', @@ -25,4 +21,16 @@ gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], f config.paths.src + 'thesaurus/js/sprintf.js' ]; return utils.buildJsGroup(thesaurusGroup, 'thesaurus', 'thesaurus/js'); +}); + +gulp.task('watch-thesaurus-js', function() { + return gulp.watch(config.paths.src + 'thesaurus/**/*.js', ['build-thesaurus-js']); +}); + +gulp.task('watch-thesaurus-css', function() { + gulp.watch(config.paths.src + 'thesaurus/**/*.scss', ['build-thesaurus-css']); +}); + +gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], function(){ + return gulp.start('build-thesaurus-js'); }); \ No newline at end of file diff --git a/resources/gulp/watch.js b/resources/gulp/watch.js index 7464978bfb..d3e3d89da6 100644 --- a/resources/gulp/watch.js +++ b/resources/gulp/watch.js @@ -5,22 +5,43 @@ var debug = require('gulp-debug'); var fs = require('fs'); var utils = require('./utils.js'); -gulp.task('watch', function(){ - gulp.start('watch-common'); - gulp.start('watch-oauth'); - gulp.start('watch-prod'); - gulp.start('watch-thesaurus'); +gulp.task('watch-css', function(){ + gulp.start('watch-common-css'); + gulp.start('watch-oauth-css'); + gulp.start('watch-prod-css'); + gulp.start('watch-thesaurus-css'); //gulp.start('watch-uploadFlash'); - gulp.start('watch-lightbox'); - gulp.start('watch-admin'); - gulp.start('watch-report'); - gulp.start('watch-account'); + gulp.start('watch-lightbox-css'); + gulp.start('watch-admin-css'); + gulp.start('watch-report-css'); + gulp.start('watch-account-css'); // gulp.start('watch-permaview'); - gulp.start('watch-setup'); - gulp.start('watch-authentication'); + gulp.start('watch-setup-css'); + gulp.start('watch-authentication-css'); +}); + +gulp.task('watch-js', function(){ + gulp.start('watch-common-js'); + // gulp.start('watch-oauth-js'); + gulp.start('watch-prod-js'); + gulp.start('watch-thesaurus-js'); + //gulp.start('watch-uploadFlash'); + gulp.start('watch-lightbox-js'); + gulp.start('watch-admin-js'); + gulp.start('watch-report-js'); + gulp.start('watch-account-js'); + // gulp.start('watch-permaview'); + gulp.start('watch-setup-js'); + gulp.start('watch-authentication-js'); +}); + +gulp.task('watch', function(){ + gulp.start('watch-css'); + gulp.start('watch-js'); }); var browserSync = require('browser-sync').create(); + gulp.task('sync', ['watch'], function(){ // will open browser in http://localhost:3000/ browserSync.init({