gulpfile.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const path = require( 'path' );
  7. const gulp = require( 'gulp' );
  8. // Lint tasks. ---------------------------------------------------------------
  9. const ckeditor5Lint = require( '@ckeditor/ckeditor5-dev-lint' )();
  10. gulp.task( 'lint', ckeditor5Lint.lint );
  11. gulp.task( 'lint-staged', ckeditor5Lint.lintStaged );
  12. gulp.task( 'pre-commit', [ 'lint-staged' ] );
  13. // Documentation. -------------------------------------------------------------
  14. gulp.task( 'docs', () => {
  15. return require( '@ckeditor/ckeditor5-dev-docs' )
  16. .build( {
  17. readmePath: path.join( process.cwd(), 'README.md' ),
  18. sourceFiles: [
  19. process.cwd() + '/packages/ckeditor5-*/src/**/*.@(js|jsdoc)',
  20. '!' + process.cwd() + '/packages/ckeditor5-*/src/lib/**/*.js'
  21. ],
  22. destinationPath: path.join( process.cwd(), 'build', 'docs' )
  23. } );
  24. } );
  25. // Tests. ---------------------------------------------------------------------
  26. gulp.task( 'test', () => {
  27. return require( '@ckeditor/ckeditor5-dev-tests' )
  28. .runAutomatedTests( getTestOptions() );
  29. } );
  30. gulp.task( 'test:manual', () => {
  31. return require( '@ckeditor/ckeditor5-dev-tests' )
  32. .runManualTests( getTestOptions() );
  33. } );
  34. function getTestOptions() {
  35. return require( '@ckeditor/ckeditor5-dev-tests' )
  36. .parseArguments( process.argv.slice( 2 ) );
  37. }
  38. // Translations. --------------------------------------------------------------
  39. gulp.task( 'translations:collect', () => {
  40. return require( '@ckeditor/ckeditor5-dev-env' ).collectTranslations();
  41. } );
  42. gulp.task( 'translations:upload', () => {
  43. return require( '@ckeditor/ckeditor5-dev-env' ).uploadTranslations();
  44. } );
  45. gulp.task( 'translations:download', () => {
  46. return require( '@ckeditor/ckeditor5-dev-env' ).downloadTranslations();
  47. } );
  48. // Releasing. -----------------------------------------------------------------
  49. gulp.task( 'changelog:dependencies', () => {
  50. return require( '@ckeditor/ckeditor5-dev-env' )
  51. .generateChangelogForDependencies( {
  52. cwd: process.cwd(),
  53. packages: 'packages'
  54. } );
  55. } );
  56. gulp.task( 'release:dependencies', () => {
  57. return require( '@ckeditor/ckeditor5-dev-env' )
  58. .releaseDependencies( {
  59. cwd: process.cwd(),
  60. packages: 'packages'
  61. } );
  62. } );