X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-demo.git;a=blobdiff_plain;f=afm-client%2Fgulpfile.js;fp=afm-client%2Fgulpfile.js;h=a79835afe340c500a28a2466d7235e18a187f5c0;hp=3ec87742e8bd80e42947da75bf18404add84398a;hb=96190f9cd583d9182c692c88d3342109bad81157;hpb=922b183f441a6e68b55592596fa62cc6e1814f74 diff --git a/afm-client/gulpfile.js b/afm-client/gulpfile.js index 3ec8774..a79835a 100644 --- a/afm-client/gulpfile.js +++ b/afm-client/gulpfile.js @@ -23,7 +23,6 @@ config=require (appdir + "etc/_Config"); // upload user local preferences if any // Run node in debug mode in developpement mode ? var nodeopts = config.DEBUG !== undefined ? '--debug='+config.DEBUG : ''; var frontend= appdir + config.FRONTEND; -var backend = appdir + config.BACKEND; var paths = { application : frontend, @@ -35,7 +34,6 @@ var paths = { partials : [frontend + '/**/*.html', '!' + frontend +'/index.html'], distDev : './dist.dev', distProd : './dist.prod', - scriptsDevServer: backend + '/**/*.js', sass: [frontend+'/styles', 'bower_components/foundation-apps/scss','bower_components/foundation-icon-fonts'], fonts: ['bower_components/**/*.woff'], favicon: frontend+'/favicon.ico' @@ -103,11 +101,6 @@ pipes.builtVendorScriptsProd = function() { .pipe(gulp.dest(paths.distProd+ '/bower_components')); }; -pipes.validatedDevServerScripts = function() { - return gulp.src(paths.scriptsDevServer) - .pipe(plugins.jshint()) - .pipe(plugins.jshint.reporter('jshint-stylish')); -}; pipes.validatedPartials = function() { return gulp.src(paths.partials) @@ -279,16 +272,7 @@ pipes.builtAppProd = function() { gulp.task('help', taskListing.withFilters(/-/)); // clean, build of production environement -gulp.task('build', ['clean-build-app-prod', 'validate-devserver-scripts']); - -gulp.task('run', function() { - // start nodemon to auto-reload the dev server - plugins.nodemon({ script: 'server.js', ext: 'js', watch: ['devServer/']}) - .on('change', ['validate-devserver-scripts']) - .on('restart', function () { - console.log('[nodemon] restarted dev server'); - }); -}); +gulp.task('build', ['clean-build-app-prod']); // removes all compiled dev files gulp.task('clean-dev', function() { @@ -320,9 +304,6 @@ gulp.task('build-partials-dev', pipes.builtPartialsDev); // converts partials to javascript using html2js gulp.task('convert-partials-to-js', pipes.scriptedPartials); -// runs jshint on the dev server scripts -gulp.task('validate-devserver-scripts', pipes.validatedDevServerScripts); - // runs jshint on the app scripts gulp.task('validate-app-scripts', pipes.validatedAppScripts); @@ -363,23 +344,7 @@ gulp.task('clean-build-app-dev', ['clean-dev'], pipes.builtAppDev); gulp.task('clean-build-app-prod', ['clean-prod'], pipes.builtAppProd); // clean, build, and watch live changes to the dev environment -gulp.task('watch-dev', ['clean-build-app-dev', 'validate-devserver-scripts'], function() { - - // start nodemon to auto-reload the dev server - plugins.nodemon({ exec: 'node ' + nodeopts, script: backend+'/server.js', ext: 'js', watch: [backend], env: {NODE_ENV : 'dev'} }) - .on('change', ['validate-devserver-scripts']) - .on('restart', function () { - console.log('[nodemon] restarted dev server'); - }); - - // start live-reload server - plugins.livereload.listen({ start: true }); - - // watch index - gulp.watch(paths.index, function() { - return pipes.builtIndexDev() - .pipe(plugins.livereload()); - }); +gulp.task('watch-dev', ['clean-build-app-dev'], function() { // watch app scripts gulp.watch(paths.scripts, function() { @@ -408,17 +373,7 @@ gulp.task('watch-dev', ['clean-build-app-dev', 'validate-devserver-scripts'], fu }); // clean, build, and watch live changes to the prod environment -gulp.task('watch-prod', ['clean-build-app-prod', 'validate-devserver-scripts'], function() { - - // start nodemon to auto-reload the dev server - plugins.nodemon({ script: backend +'/server.js', ext: 'js', watch: [backend], env: {MODE : 'prod'} }) - .on('change', ['validate-devserver-scripts']) - .on('restart', function () { - console.log('[nodemon] restarted dev server'); - }); - - // start live-reload server - plugins.livereload.listen({start: true}); +gulp.task('watch-prod', ['clean-build-app-prod'], function() { // watch index gulp.watch(paths.index, function() {