gulpfile.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright 2018 Scytl Secure Electronic Voting SA
  3. *
  4. * All rights reserved
  5. *
  6. * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
  7. */
  8. const gulp = require('gulp');
  9. const del = require('del');
  10. const runSequence = require('run-sequence');
  11. const paths = require('./paths.json');
  12. const {
  13. handleTaskSequenceError,
  14. } = require('./tasks/helpers');
  15. require('./tasks/compile-js');
  16. require('./tasks/release');
  17. require('./tasks/compile-docs');
  18. gulp.task('clean', () => {
  19. return del([paths.global.dist]);
  20. });
  21. gulp.task('compile', (done) => {
  22. runSequence(
  23. 'clean',
  24. 'build-js',
  25. handleTaskSequenceError(done)
  26. );
  27. });
  28. gulp.task('build', (done) => {
  29. runSequence(
  30. 'clean',
  31. 'unit-tests',
  32. [
  33. 'build-js',
  34. 'generate-docs',
  35. 'build-js:for-doc',
  36. ],
  37. handleTaskSequenceError(done)
  38. );
  39. });
  40. gulp.task('dev', (done) => {
  41. runSequence(
  42. 'build',
  43. 'watch:js',
  44. handleTaskSequenceError(done)
  45. );
  46. });
  47. // Run the gulp
  48. gulp.task('default', function () {
  49. console.log('Executing gulp and getting info from package.json');
  50. });